* Clean up

clear all

set maxvar 10000

/*
* Set working directory: please set your own
cd "/Users/vicentevalentim/Desktop/fragmentation_replication_bjps"
*/

use Data/Data_PSRM, clear

** UPDATES ON DATA FROM DINAS ET AL **


gen edate = " "

rename country countryname
rename party partyname

gen country = .
gen eleccount = .

*

********************************************************************************
************************** 1. Adding missing parties ***************************
********************************************************************************

** Poland 1993 has threshold of 8 for one party, but should be 5, so I correct it.
replace threshold = 5 if partyname == "ZChN" & countryname == "Poland" & year == 1993

** RUSSIA 2011: adding non parliamentary parties

insobs 3, before(1) 

replace countryname = "Russia" in 1/3
replace year = 2011 in 1/3
replace threshold = 7 in 1/3
replace edate = "04dec2011" in 1/3

replace partyname = "Yabloko" in 1
replace votes = 3.43 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "Patriots of Russia" in 2
replace votes = 0.97 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "Right Cause" in 3
replace votes = 0.6 in 3
replace seats = 0 in 3
replace treat = 0 in 3

** TAIWAN 1992: adding non parliamentary parties

br if countryname == "Taiwan" & year == 1992
insobs 12, before(1) 

replace countryname = "Taiwan" in 1/12
replace year = 1992 in 1/12
replace threshold = 5 in 1/12
replace edate = "19dec1992" in 1/12

replace partyname = "Chinese Social Democratic Party" in 1
replace votes = 1.33 in 1
replace seats = 1 in 1
replace treat = 0 in 1

replace partyname = "Workers' Party" in 2
replace votes = 0.34 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "China Justice Party" in 3
replace votes = 0.0 in 3
replace seats = 0 in 3
replace treat = 0 in 3

replace partyname = "Labor Party" in 4
replace votes = 0.12 in 4
replace seats = 0 in 4
replace treat = 0 in 4

replace partyname = "Truth Party" in 5
replace votes = 0.07 in 5
replace seats = 0 in 5
replace treat = 0 in 5

replace partyname = "China Unity Party" in 6
replace votes = 0.02 in 6
replace seats = 0 in 6
replace treat = 0 in 6

replace partyname = "People's Action Party" in 7
replace votes = 0.01 in 7
replace seats = 0 in 7
replace treat = 0 in 7

replace partyname = "Chinese Youth Party" in 8
replace votes = 0.01 in 8
replace seats = 0 in 8
replace treat = 0 in 8

replace partyname = "National Revival Party" in 9
replace votes = 0.01 in 9
replace seats = 0 in 9
replace treat = 0 in 9

replace partyname = "China All People Welfare Party" in 10
replace votes = 0.01 in 10
replace seats = 0 in 10
replace treat = 0 in 10

replace partyname = "China Democratic Socialist Party" in 11
replace votes = 0.0 in 11
replace seats = 0 in 11
replace treat = 0 in 11

replace partyname = "China Great Harmony Democratic Party" in 12
replace votes = 0.0 in 12
replace seats = 0 in 12
replace treat = 0 in 12

** ALBANIA 2001: the data seem off, so I replace it with newly collected data
* cf. here, p. 30: https://www.osce.org/files/f/documents/a/5/16856.pdf
drop if countryname == "Albania" & year == 2005

insobs 22, before(1) 

** ALBANIA 2005: the data seem off, so I replace it with newly collected data
* cf. here, p. 30: https://www.osce.org/files/f/documents/a/5/16856.pdf
drop if countryname == "Albania" & year == 2005

insobs 22, before(1) 

replace countryname = "Albania" in 1/24
replace year = 2005 in 1/24
replace threshold = 2.5 in 1/24
replace edate = "03jul2005" in 1/24

replace partyname = "DP" in 1
replace votes = 7.67 in 1
replace seats = 56 in 1
replace treat = 1 in 1

replace partyname = "SP" in 2
replace votes = 8.89 in 2
replace seats = 42 in 2
replace treat = 1 in 2

replace partyname = "SDP" in 3
replace votes = 12.74  in 3
replace seats = 7 in 3
replace treat = 1 in 3

replace partyname = "SMI" in 4
replace votes = 8.4  in 4
replace seats = 5 in 4
replace treat = 1 in 4

replace partyname = "EAP" in 5
replace votes = 6.56  in 5
replace seats = 4 in 5
replace treat = 1 in 5

replace partyname = "DA" in 6
replace votes = 4.76  in 6
replace seats = 3 in 6
replace treat = 1 in 6

replace partyname = "SDY" in 7
replace votes = 4.25  in 7
replace seats = 2 in 7
replace treat = 1 in 7

replace partyname = "Movement for National Development" in 8
replace votes = 3.51 in 8
replace seats = 0 in 8
replace treat = 0 in 8

replace partyname = "Communist Party of Albania" in 9
replace votes = 0.65 in 9
replace seats = 0 in 9
replace treat = 0 in 9

replace partyname = "Party of Labour of Albania" in 10
replace votes = 0.68 in 10
replace seats = 0 in 10
replace treat = 0 in 10

replace partyname = "Alliance for Welfare and Solidarity" in 11
replace votes = 0.37 in 11
replace seats = 0 in 11
replace treat = 0 in 11

replace partyname = "Social Albanian Parties – National Unity Party" in 12
replace votes = 0.24 in 12
replace seats = 0 in 12
replace treat = 0 in 12

replace partyname = "Albanian National Front Party" in 13
replace votes = 1.68 in 13
replace seats = 0 in 13
replace treat = 0 in 13

replace partyname = "Albanian Democratic Monarchist Movement Party" in 14
replace votes = 0.06 in 14
replace seats = 0 in 14
replace treat = 0 in 14

replace partyname = "Albanian Green League" in 15
replace votes = 0.13 in 15
replace seats = 0 in 15
replace treat = 0 in 15

replace partyname = "Albanian Democratic Party for a New Right Democracy" in 16
replace votes = 0.13 in 16
replace seats = 0 in 16
replace treat = 0 in 16

replace partyname = "Albanian Socialist Alliance Party" in 17
replace votes = 0.48 in 17
replace seats = 0 in 17
replace treat = 0 in 17

replace partyname = "Party for Justice and Integration" in 18
replace votes = 1.17 in 18
replace seats = 0 in 18
replace treat = 0 in 18

replace partyname = "Freedom and Human Rights Movements" in 19
replace votes = 0.66 in 19
replace seats = 0 in 19
replace treat = 0 in 19

replace partyname = "Democratic National Front Party" in 20
replace votes = 0.56 in 20
replace seats = 0 in 20
replace treat = 0 in 20

replace partyname = "Albanian Democratic Union Party" in 21
replace votes = 0.54 in 21
replace seats = 0 in 21
replace treat = 0 in 21

replace partyname = "Albanian National Security Party" in 22
replace votes = 0.04 in 22
replace seats = 0 in 22
replace treat = 0 in 22

replace partyname = "HRUP" in 23
replace votes = 4.13 in 23
replace seats = 2 in 23
replace treat = 1 in 23

replace partyname = "AFJW " in 24
replace votes = 33.46 in 24
replace seats = 18 in 24
replace treat = 1 in 24

** BULGARIA 1990: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING
insobs 3, before(1) 

replace countryname = "Bulgaria" in 1/3
replace year = 1990 in 1/3
replace threshold = 4 in 1/3
replace edate = "10jun1990" in 1/3

replace partyname = "Alternative Socialist Party" in 1
replace votes = 0.36 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "Alternative Socialist Union" in 2
replace votes = 0.26 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "Liberal Party – Pernik" in 3
replace votes = 0.25 in 3
replace seats = 0 in 3
replace treat = 0 in 3

*/
** GREECE 1993: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING
insobs 24, before(1) 

replace countryname = "Greece" in 1/24
replace year = 1993 in 1/24
replace threshold = 3 in 1/24
replace edate = "10oct1993" in 1/24

replace partyname = "Trust" in 1
replace votes = 0.38 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "Union of Centrists" in 2
replace votes = 0.23 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "Fate" in 3
replace votes = 0.18 in 3
replace seats = 0 in 3
replace treat = 0 in 3

replace partyname = "National Party–National Political Union" in 4
replace votes = 0.14 in 4
replace seats = 0 in 4
replace treat = 0 in 4

replace partyname = "Left Struggle" in 5
replace votes = 0.12 in 5
replace seats = 0 in 5
replace treat = 0 in 5

replace partyname = "Popular Unions of Bipartisan Social Groups" in 6
replace votes = 0.10 in 6
replace seats = 0 in 6
replace treat = 0 in 6

replace partyname = "Ecologists of Greece" in 7
replace votes = 0.08 in 7
replace seats = 0 in 7
replace treat = 0 in 7

replace partyname = "Union of Ecologists" in 8
replace votes = 0.08 in 8
replace seats = 0 in 8
replace treat = 0 in 8

replace partyname = "Party of Greek Hunters" in 9
replace votes = 0.05 in 9
replace seats = 0 in 9
replace treat = 0 in 9

replace partyname = "Marxist–Leninist Communist Party of Greece" in 10
replace votes = 0.03 in 10
replace seats = 0 in 10
replace treat = 0 in 10

replace partyname = "Fighting Socialist Party of Greece" in 11
replace votes = 0.02 in 11
replace seats = 0 in 11
replace treat = 0 in 11

replace partyname = "Olympic Party" in 12
replace votes = 0.01 in 12
replace seats = 0 in 12
replace treat = 0 in 12

replace partyname = "Organization for the Reconstruction of the Communist Party of Greece" in 13
replace votes = 0.01 in 13
replace seats = 0 in 13
replace treat = 0 in 13

replace partyname = "Consistent Left Move of Greece" in 14
replace votes = 0.01 in 14
replace seats = 0 in 14
replace treat = 0 in 14

replace partyname = "Self-Respect and Truth" in 15
replace votes = 0 in 15
replace seats = 0 in 15
replace treat = 0 in 15

replace partyname = "Human Rights Party" in 16
replace votes = 0 in 16
replace seats = 0 in 16
replace treat = 0 in 16

replace partyname = "Christian Faith" in 17
replace votes = 0 in 17
replace seats = 0 in 17
replace treat = 0 in 17

replace partyname = "Hellenic Orthodox Democratic Movement" in 18
replace votes = 0 in 18
replace seats = 0 in 18
replace treat = 0 in 18

replace partyname = "Political Independent Party Vergina 1990" in 19
replace votes = 0 in 19
replace seats = 0 in 19
replace treat = 0 in 19

replace partyname = "Hellenic White Movement of Contemporary Ideology" in 20
replace votes = 0 in 20
replace seats = 0 in 20
replace treat = 0 in 20

replace partyname = "Party of Responsible Citizens" in 21
replace votes = 0 in 21
replace seats = 0 in 21
replace treat = 0 in 21

replace partyname = "Humanism and Peace Party" in 22
replace votes = 0 in 22
replace seats = 0 in 22
replace treat = 0 in 22

replace partyname = "Free Democrats Party of Greece" in 23
replace votes = 0 in 23
replace seats = 0 in 23
replace treat = 0 in 23

replace partyname = "Greens" in 24
replace votes = 0 in 24
replace seats = 0 in 24
replace treat = 0 in 24


** GREECE 1996: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING
insobs 23, before(1) 

replace countryname = "Greece" in 1/23
replace year = 1996 in 1/23
replace threshold = 3 in 1/23
replace edate = "22sep1996" in 1/23

replace partyname = "Union of Centrists" in 1
replace votes = 0.72 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "Union of Ecologists" in 2
replace votes = 0.29 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "Party of Greek Hunters" in 3
replace votes = 0.26 in 3
replace seats = 0 in 3
replace treat = 0 in 3

replace partyname = "National Party–National Political Union" in 4
replace votes = 0.24 in 4
replace seats = 0 in 4
replace treat = 0 in 4

replace partyname = "Party of Hellenism" in 5
replace votes = 0.18 in 5
replace seats = 0 in 5
replace treat = 0 in 5

replace partyname = "Left Struggle" in 6
replace votes = 0.15 in 6
replace seats = 0 in 6
replace treat = 0 in 6

replace partyname = "Alternative Ecologists" in 7
replace votes = 0.08 in 7
replace seats = 0 in 7
replace treat = 0 in 7

replace partyname = "Golden Dawn" in 8
replace votes = 0.07 in 8
replace seats = 0 in 8
replace treat = 0 in 8

replace partyname = "Marxist–Leninist Communist Party of Greece" in 9
replace votes = 0.06 in 9
replace seats = 0 in 9
replace treat = 0 in 9

replace partyname = "Organization for the Reconstruction of the Communist Party of Greece" in 10
replace votes = 0.05 in 10
replace seats = 0 in 10
replace treat = 0 in 10

replace partyname = "Pensioners-Labourers-Farmers-Youth Alliance" in 11
replace votes = 0.04 in 11
replace seats = 0 in 11
replace treat = 0 in 11

replace partyname = "Fighting Socialist Party of Greece" in 12
replace votes = 0.03 in 12
replace seats = 0 in 12
replace treat = 0 in 12

replace partyname = "Olympic Party" in 13
replace votes = 0.02 in 13
replace seats = 0 in 13
replace treat = 0 in 13

replace partyname = "Party of Greek Workers" in 14
replace votes = 0.00 in 14
replace seats = 0 in 14
replace treat = 0 in 14

replace partyname = "Greek Orthodox National Popular Revolutionary Party" in 15
replace votes = 0 in 15
replace seats = 0 in 15
replace treat = 0 in 15

replace partyname = "Christian Faith" in 16
replace votes = 0 in 16
replace seats = 0 in 16
replace treat = 0 in 16

replace partyname = "Free Democracy" in 17
replace votes = 0 in 17
replace seats = 0 in 17
replace treat = 0 in 17

replace partyname = "Hellenic White Movement of Contemporary Ideology" in 18
replace votes = 0 in 18
replace seats = 0 in 18
replace treat = 0 in 18

replace partyname = "Panhellenic Orthodox Democratic Movement" in 19
replace votes = 0 in 19
replace seats = 0 in 19
replace treat = 0 in 19

replace partyname = "Labour Class" in 20
replace votes = 0 in 20
replace seats = 0 in 20
replace treat = 0 in 20

replace partyname = "Human Rights Party" in 21
replace votes = 0 in 21
replace seats = 0 in 21
replace treat = 0 in 21

replace partyname = "Party of Responsible Citizens" in 22
replace votes = 0 in 22
replace seats = 0 in 22
replace treat = 0 in 22

replace partyname = "Hellenic European Party" in 23
replace votes = 0 in 23
replace seats = 0 in 23
replace treat = 0 in 23

** GREECE 2000: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING
insobs 19, before(1) 

replace countryname = "Greece" in 1/19
replace year = 2000 in 1/19
replace threshold = 3 in 1/19
replace edate = "09apr2000" in 1/19

replace partyname = "Democratic Regional Union" in 1
replace votes = 0.47 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "Union of Centrists" in 2
replace votes = 0.34 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "Union of Ecologists" in 3
replace votes = 0.30 in 3
replace seats = 0 in 3
replace treat = 0 in 3

replace partyname = "National Coalition" in 4
replace votes = 0.21 in 4
replace seats = 0 in 4
replace treat = 0 in 4

replace partyname = "Front Line" in 5
replace votes = 0.18 in 5
replace seats = 0 in 5
replace treat = 0 in 5

replace partyname = "Radical Left Front" in 6
replace votes = 0.12 in 6
replace seats = 0 in 6
replace treat = 0 in 6

replace partyname = "Communist Party of Greece (Marxist–Leninist)" in 7
replace votes = 0.11 in 7
replace seats = 0 in 7
replace treat = 0 in 7

replace partyname = "Party of Hellenism" in 8
replace votes = 0.09 in 8
replace seats = 0 in 8
replace treat = 0 in 8

replace partyname = "Left! (M-L KKE–A)" in 9
replace votes = 0.09 in 9
replace seats = 0 in 9
replace treat = 0 in 9

replace partyname = "Alternative Ecologists" in 10
replace votes = 0.05 in 10
replace seats = 0 in 10
replace treat = 0 in 10

replace partyname = "Liberal Party" in 11
replace votes = 0.03 in 11
replace seats = 0 in 11
replace treat = 0 in 11

replace partyname = "Fighting Socialist Party of Greece" in 12
replace votes = 0.03 in 12
replace seats = 0 in 12
replace treat = 0 in 12

replace partyname = "Self-Governed Movement of Labour Politics" in 13
replace votes = 0.02 in 13
replace seats = 0 in 13
replace treat = 0 in 13

replace partyname = "Organization for the Reconstruction of the Communist Party of Greece" in 14
replace votes = 0.02 in 14
replace seats = 0 in 14
replace treat = 0 in 14

replace partyname = "Christian Faith" in 15
replace votes = 0 in 15
replace seats = 0 in 15
replace treat = 0 in 15

replace partyname = "Party of Greek Workers" in 16
replace votes = 0 in 16
replace seats = 0 in 16
replace treat = 0 in 16

replace partyname = "National Patriotic Party" in 17
replace votes = 0 in 17
replace seats = 0 in 17
replace treat = 0 in 17

replace partyname = "Olympic Party" in 18
replace votes = 0 in 18
replace seats = 0 in 18
replace treat = 0 in 18

replace partyname = "Panhellenic Democratic Party of Peace" in 19
replace votes = 0 in 19
replace seats = 0 in 19
replace treat = 0 in 19

** GREECE 2004: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING
insobs 10, before(1) 

replace countryname = "Greece" in 1/10
replace year = 2004 in 1/10
replace threshold = 3 in 1/10
replace edate = "07mar2004" in 1/10

replace partyname = "Union of Centrists" in 1
replace votes = 0.3 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "Radical Left Front" in 2
replace votes = 0.2 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "Communist Party of Greece (Marxist-Leninist)" in 3
replace votes = 0.1 in 3
replace seats = 0 in 3
replace treat = 0 in 3

replace partyname = "Anti-Capitalist Alliance" in 4
replace votes = 0.1 in 4
replace seats = 0 in 4
replace treat = 0 in 4

replace partyname = "Hellenic Front" in 5
replace votes = 0.1 in 5
replace seats = 0 in 5
replace treat = 0 in 5

replace partyname = "Marxist-Leninist Communist Party of Greece" in 6
replace votes = 0.1 in 6
replace seats = 0 in 6
replace treat = 0 in 6

replace partyname = "Fighting Socialist Party of Greece" in 7
replace votes = 0.11 in 7
replace seats = 0 in 7
replace treat = 0 in 7

replace partyname = "Liberal Party" in 8
replace votes = 0.09 in 8
replace seats = 0 in 8
replace treat = 0 in 8

replace partyname = "Organization for the Reconstruction of the Communist Party of Greece" in 9
replace votes = 0.09 in 9
replace seats = 0 in 9
replace treat = 0 in 9

replace partyname = "Christian Faith" in 10
replace votes = 0.05 in 10
replace seats = 0 in 10
replace treat = 0 in 10

** GREECE 2007: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING
insobs 12, before(1) 

replace countryname = "Greece" in 1/12
replace year = 2007 in 1/12
replace threshold = 3 in 1/12
replace edate = "16sep2007" in 1/12

replace partyname = "Democratic Revival" in 1
replace votes = 0.8 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "Union of Centrists" in 2
replace votes = 0.29 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "Communist Party (Marxist-Leninist) (KKE (M-L)) " in 3
replace votes = 0.24 in 3
replace seats = 0 in 3
replace treat = 0 in 3

replace partyname = "ARadical Left Front (MERA) " in 4
replace votes = 0.17 in 4
replace seats = 0 in 4
replace treat = 0 in 4

replace partyname = "United Anti-Capitalist Left (ENANTIA)" in 5
replace votes = 0.15 in 5
replace seats = 0 in 5
replace treat = 0 in 5

replace partyname = "Marxist-Leninist Communist Party (M-L KKE) " in 6
replace votes = 0.11 in 6
replace seats = 0 in 6
replace treat = 0 in 6

replace partyname = "Liberal Alliance" in 7
replace votes = 0.11 in 7
replace seats = 0 in 7
replace treat = 0 in 7

replace partyname = "Liberal Party" in 8
replace votes = 0.04 in 8
replace seats = 0 in 8
replace treat = 0 in 8

replace partyname = "Organization for the Reconstruction of the Communist Party of Greece" in 9
replace votes = 0.03 in 9
replace seats = 0 in 9
replace treat = 0 in 9

replace partyname = "Fighting Socialist Party (ASKE)" in 10
replace votes = 0.03 in 10
replace seats = 0 in 10
replace treat = 0 in 10

replace partyname = "Greek Ecologists" in 11
replace votes = 0.02 in 11
replace seats = 0 in 11
replace treat = 0 in 11

replace partyname = "Light – Truth – Justice (Φως – Αλήθεια – Δικαιοσύνη)" in 12
replace votes = 0.01 in 12
replace seats = 0 in 12
replace treat = 0 in 12


** GREECE 2009: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING
insobs 17, before(1) 

replace countryname = "Greece" in 1/17
replace year = 2009 in 1/17
replace threshold = 3 in 1/17
replace edate = "04oct2009" in 1/17

replace partyname = "Democratic Revival" in 1
replace votes = 0.45 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "Front of the Greek Anticapitalist Left (ANTARSYA)" in 2
replace votes = 0.36 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "Greek Ecologists (EI)" in 3
replace votes = 0.29 in 3
replace seats = 0 in 3
replace treat = 0 in 3

replace partyname = "Popular Association-Golden Dawn (ΧΑ) " in 4
replace votes = 0.29 in 4
replace seats = 0 in 4
replace treat = 0 in 4

replace partyname = "Union of Centrists (EK)" in 5
replace votes = 0.27 in 5
replace seats = 0 in 5
replace treat = 0 in 5

replace partyname = "Society-Political Party of the Successors of Kapodistrias (Koinonia)" in 6
replace votes = 0.16 in 6
replace seats = 0 in 6
replace treat = 0 in 6

replace partyname = "Communist Party of Greece (Marxist–Leninist) (KKE (m-l)" in 7
replace votes = 0.15 in 7
replace seats = 0 in 7
replace treat = 0 in 7

replace partyname = "Democrats (Dimokratikoi)" in 8
replace votes = 0.11 in 8
replace seats = 0 in 8
replace treat = 0 in 8

replace partyname = "Marxist–Leninist Communist Party of Greece (M-L KKE)" in 9
replace votes = 0.08 in 9
replace seats = 0 in 9
replace treat = 0 in 9

replace partyname = "Workers' Revolutionary Party (EEK)" in 10
replace votes = 0.03 in 10
replace seats = 0 in 10
replace treat = 0 in 10

replace partyname = "Organisation for the Reconstruction of the KKE (OAKKE)" in 11
replace votes = 0.02 in 11
replace seats = 0 in 11
replace treat = 0 in 11

replace partyname = "Panagrarian Labour Movement of Greece (PAEKE)" in 12
replace votes = 0.02 in 12
replace seats = 0 in 12
replace treat = 0 in 12

replace partyname = "Smoking Groups for Art and Artistic Creation (KOTES)" in 13
replace votes = 0.02 in 13
replace seats = 0 in 13
replace treat = 0 in 13

replace partyname = "Light-Truth-Justice (FAD)" in 14
replace votes = 0.01 in 14
replace seats = 0 in 14
replace treat = 0 in 14

replace partyname = "Friends of Man (FTA)" in 15
replace votes = 0 in 15
replace seats = 0 in 15
replace treat = 0 in 15

replace partyname = "Regional Urban Development (PAA)" in 16
replace votes = 0.02 in 16
replace seats = 0 in 16
replace treat = 0 in 16

replace partyname = "Old Republic (PD)" in 17
replace votes = 0.02 in 17
replace seats = 0 in 17
replace treat = 0 in 17


** HUNGARY 2002: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING
* NOTE: previous Hungarian elections do not have all non-parliamentary parties, 
* but they do include at least the four closest to threshold, which is all we use in the analyses
* For this reason, I don't update them
insobs 5, before(1) 

replace countryname = "Hungary" in 1/5
replace year = 2002 in 1/5
replace threshold = 5 in 1/5
replace edate = "07apr2002" in 1/5

replace partyname = "Hungarian Justice and Life Party" in 1
replace votes = 4.6 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "Centre Party-KDNP" in 2
replace votes = 3.2 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "Workers' Party" in 3
replace votes = 1.9 in 3
replace seats = 0 in 3
replace treat = 0 in 3

replace partyname = "Independent Smallholders' Party" in 4
replace votes = 1.2 in 4
replace seats = 0 in 4
replace treat = 0 in 4

replace partyname = "New Left Party" in 5
replace votes = 0.1 in 5
replace seats = 0 in 5
replace treat = 0 in 5


** HUNGARY 2006: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING
* NOTE: previous Hungarian elections do not have all non-parliamentary parties, 
* but they do include at least the four closest to threshold, which is all we use in the analyses
* For this reason, I don't update them
insobs 9, before(1) 

replace countryname = "Hungary" in 1/9
replace year = 2006 in 1/9
replace threshold = 5 in 1/9
replace edate = "09apr2006" in 1/9

replace partyname = "Centre Party" in 1
replace votes = 0.3 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "Forum of Gipsy Organisations in Hungary-Party of Roma Solidarity" in 2
replace votes = 0.1 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "Party of Greens" in 3
replace votes = 0.1 in 3
replace seats = 0 in 3
replace treat = 0 in 3

replace partyname = "Christian Democratic Party - Solidarity of Christian Social Centre" in 4
replace votes = 0.1 in 4
replace seats = 0 in 4
replace treat = 0 in 4

replace partyname = "Hungarian Countryside and Civic Party" in 5
replace votes = 0.1 in 5
replace seats = 0 in 5
replace treat = 0 in 5

replace partyname = "Independent Smallholders Party" in 6
replace votes = 0.0 in 6
replace seats = 0 in 6
replace treat = 0 in 6

replace partyname = "CWorkers' Party of Hungary 2006" in 7
replace votes = 0.0 in 7
replace seats = 0 in 7
replace treat = 0 in 7

replace partyname = "Alliance of Hungarians for One Another" in 8
replace votes = 0.0 in 8
replace seats = 0 in 8
replace treat = 0 in 8

replace partyname = "Party of Independent Smallholders and National Unity" in 9
replace votes = 0.0 in 9
replace seats = 0 in 9
replace treat = 0 in 9

** HUNGARY 2010: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING
insobs 5, before(1) 

replace countryname = "Hungary" in 1/5
replace year = 2010 in 1/5
replace threshold = 5 in 1/5
replace edate = "01apr2010" in 1/5

replace partyname = "Civil Movement" in 1
replace votes = 0.9 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "Hungarian Workers' Party" in 2
replace votes = 0.1 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "Social Democratic Party of Hungary" in 3
replace votes = 0.1 in 3
replace seats = 0 in 3
replace treat = 0 in 3

replace partyname = "Unity Party" in 4
replace votes = 0.1 in 4
replace seats = 0 in 4
replace treat = 0 in 4

replace partyname = "Hungarian Justice and Life Party" in 5
replace votes = 0 in 5
replace seats = 0 in 5
replace treat = 0 in 5


** ISRAEL 1949: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING

insobs 9, before(1) 

replace countryname = "Israel" in 1/9
replace year = 1949 in 1/9
replace threshold = 0.83 in 1/9
replace edate = "25jan1949" in 1/9

replace partyname = "Workers Bloc" in 1
replace votes = 0.74 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "Jabotinsky Movement – Brit HaTzohar" in 2
replace votes = 0.67 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "Haredi List" in 3
replace votes = 0.65 in 3
replace seats = 0 in 3
replace treat = 0 in 3

replace partyname = "Popular Arab Bloc" in 4
replace votes = 0.65 in 4
replace seats = 0 in 4
replace treat = 0 in 44

replace partyname = "Working and Religious Women" in 5
replace votes = 0.64 in 5
replace seats = 0 in 5
replace treat = 0 in 5

replace partyname = "Yitzhak Gruenbaum List" in 6
replace votes = 0.58 in 6
replace seats = 0 in 6
replace treat = 0 in 6

replace partyname = "United List of Religious Workers" in 7
replace votes = 0.29 in 7
replace seats = 0 in 7
replace treat = 0 in 7

replace partyname = "For Jerusalem" in 8
replace votes = 0.19 in 8
replace seats = 0 in 8
replace treat = 0 in 8

replace partyname = "Traditional Judaism List" in 9
replace votes = 0.05 in 9
replace seats = 0 in 9
replace treat = 0 in 9


** ISRAEL 1951: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING

insobs 2, before(1) 

replace countryname = "Israel" in 1/2
replace year = 1951 in 1/2
replace threshold = 1 in 1/2
replace edate = "30jul1951" in 1/2

replace partyname = "Sepharadim-Ashkenazim Unity" in 1
replace votes = 0.59 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "For New Immigrants and Freed Soldiers" in 2
replace votes = 0.05 in 2
replace seats = 0 in 2
replace treat = 0 in 2

** ISRAEL 1955: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING

* Correct one vote share
replace votes = 0.29 if partyname == "YA" & countryname == "Israel" & year == 1955

insobs 5, before(1) 

replace countryname = "Israel" in 1/5
replace year = 1955 in 1/5
replace threshold = 1 in 1/5
replace edate = "26jul1955" in 1/5

replace partyname = "Sephardim and Oriental Communities" in 1
replace votes = 0.82 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "Arab List – The Centre" in 2
replace votes = 0.53 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "Likud – Popular Economic Movement" in 3
replace votes = 0.36 in 3
replace seats = 0 in 3
replace treat = 0 in 3

replace partyname = "New Immigrants' List" in 4
replace votes = 0.14 in 4
replace seats = 0 in 4
replace treat = 0 in 4

replace partyname = "Original Religious List" in 5
replace votes = 0.29 in 5
replace seats = 0 in 5
replace treat = 0 in 5

** ISRAEL 1959: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING

* Correct one vote share and drop one seemingly wrong party
replace votes = 0.48 if partyname == "Progress and work" & countryname == "Israel" & year == 1959
drop if partyname == "YA" & countryname == "Israel" & year == 1959

insobs 10, before(1) 

replace countryname = "Israel" in 1/10
replace year = 1959 in 1/10
replace threshold = 1 in 1/10
replace edate = "03nov1959" in 1/10

replace partyname = "Union of North African Immigrants" in 1
replace votes = 0.85 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "Independent Faction for Israeli Arabs" in 2
replace votes = 0.39 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "Israeli Arab Labour Party" in 3
replace votes = 0.35 in 3
replace seats = 0 in 3
replace treat = 0 in 3

replace partyname = "Sephardi National Party" in 4
replace votes = 0.32 in 4
replace seats = 0 in 4
replace treat = 0 in 4

replace partyname = "National Union" in 5
replace votes = 0.25 in 5
replace seats = 0 in 5
replace treat = 0 in 5

replace partyname = "Holocaust Handicapped and Injured Faction" in 6
replace votes = 0.18 in 6
replace seats = 0 in 6
replace treat = 0 in 6

replace partyname = "Yemenite Faction" in 7
replace votes = 0.18 in 7
replace seats = 0 in 7
replace treat = 0 in 7

replace partyname = "Socialist Union (Bund)" in 8
replace votes = 0.14 in 8
replace seats = 0 in 8
replace treat = 0 in 8

replace partyname = "New Immigrants Front" in 9
replace votes = 0.07 in 9
replace seats = 0 in 9
replace treat = 0 in 9

replace partyname = "Third Power" in 10
replace votes = 0.06 in 10
replace seats = 0 in 10
replace treat = 0 in 10


** ISRAEL 1961: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING

* Correct one vote share
replace votes = 0.35 if partyname == "Progress and work" & countryname == "Israel" & year == 1961

insobs 2, before(1) 

replace countryname = "Israel" in 1/2
replace year = 1961 in 1/2
replace threshold = 1 in 1/2
replace edate = "15ago1961" in 1/2


replace partyname = "Religious Sephardim List" in 1
replace votes = 0.32 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "Supporters of Democracy" in 2
replace votes = 0.03 in 2
replace seats = 0 in 2
replace treat = 0 in 2

** ISRAEL 1965: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING

insobs 4, before(1) 

replace countryname = "Israel" in 1/4
replace year = 1965 in 1/4
replace threshold = 1 in 1/4
replace edate = "02nov1965" in 1/4

replace partyname = "Movement for Brotherhood" in 1
replace votes = 0.93 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "Peace List" in 2
replace votes = 0.46 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "Nes" in 3
replace votes = 0.18 in 3
replace seats = 0 in 3
replace treat = 0 in 3

replace partyname = "Young Israel" in 3
replace votes = 0.16 in 3
replace seats = 0 in 3
replace treat = 0 in 3

** ISRAEL 1969: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING

insobs 3, before(1) 

replace countryname = "Israel" in 1/3
replace year = 1969 in 1/3
replace threshold = 1 in 1/3
replace edate = "28oct1969" in 1/3

replace partyname = "List for the Land of Israel" in 1
replace votes = 0.56 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "Peace List" in 2
replace votes = 0.38 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "Young Israel" in 3
replace votes = 0.15 in 3
replace seats = 0 in 3
replace treat = 0 in 3

** ISRAEL 1973: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING

* Correct one vote share
replace votes = 0.63 if partyname == "Cooperation and Brotherhood" & year == 1977

insobs 2, before(1) 

replace countryname = "Israel" in 1/2
replace year = 1973 in 1/2
replace threshold = 1 in 1/2
replace edate = "31dec1973" in 1/2

replace partyname = "Black Panthers" in 1
replace votes = 0.85 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "Beit Yisrael" in 2
replace votes = 0.54 in 2
replace seats = 0 in 2
replace treat = 0 in 2


** ISRAEL 1977: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING
insobs 8, before(1) 

replace countryname = "Israel" in 1/8
replace year = 1977 in 1/8
replace threshold = 1 in 1/8
replace edate = "17may1977" in 1/8

replace partyname = "Movement for the Renewal of Social Zionism" in 1
replace votes = 0.83 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "Beit Yisrael" in 2
replace votes = 0.54 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "Arab Reform Movement" in 3
replace votes = 0.33 in 3
replace seats = 0 in 3
replace treat = 0 in 3

replace partyname = "Women's Party" in 4
replace votes = 0.32 in 4
replace seats = 0 in 4
replace treat = 0 in 4

replace partyname = "Hofesh" in 5
replace votes = 0.14 in 5
replace seats = 0 in 5
replace treat = 0 in 5

replace partyname = "New Generation" in 6
replace votes = 0.10 in 6
replace seats = 0 in 6
replace treat = 0 in 6

replace partyname = "Zionist Panthers" in 7
replace votes = 0.10 in 7
replace seats = 0 in 7
replace treat = 0 in 7

replace partyname = "Do Kiyum BeTzedek" in 8
replace votes = 0.06 in 8
replace seats = 0 in 8
replace treat = 0 in 8

** ISRAEL 1981: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING
insobs 1, before(1) 

replace countryname = "Israel" in 1
replace year = 1981 in 1
replace threshold = 1 in 1
replace edate = "30jun1981" in 1

replace partyname = "United Arab List" in 1
replace votes = 0.60 in 1
replace seats = 0 in 1
replace treat = 0 in 1

** ISRAEL 1984: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING

drop if partyname == "PS" & countryname == "Israel" & year == 1984

insobs 10, before(1) 

replace countryname = "Israel" in 1/10
replace year = 1984 in 1/10
replace threshold = 1 in 1/10
replace edate = "23jul1984" in 1/10

replace partyname = "Aryeh Eliav" in 1
replace votes = 0.74 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "Handicapped Organisation" in 2
replace votes = 0.59 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "Movement for the Renewal of Social Zionism" in 3
replace votes = 0.28 in 3
replace seats = 0 in 3
replace treat = 0 in 3

replace partyname = "Aliyah and Youth Movement" in 4
replace votes = 0.28 in 4
replace seats = 0 in 4
replace treat = 0 in 4

replace partyname = "Shiluv" in 5
replace votes = 0.27 in 5
replace seats = 0 in 5
replace treat = 0 in 5

replace partyname = "Independence" in 6
replace votes = 0.24 in 6
replace seats = 0 in 6
replace treat = 0 in 6

replace partyname = "National Organisation for the Defence of the Tenant" in 7
replace votes = 0.15 in 7
replace seats = 0 in 7
replace treat = 0 in 7

replace partyname = "Development and Peace" in 8
replace votes = 0.12 in 8
replace seats = 0 in 8
replace treat = 0 in 8

replace partyname = "Has Mas" in 9
replace votes = 0.07 in 9
replace seats = 0 in 9
replace treat = 0 in 9

replace partyname = "Movement for the Homeland" in 9
replace votes = 0.07 in 9
replace seats = 0 in 9
replace treat = 0 in 9

replace partyname = "Amkha" in 10
replace votes = 0.04 in 10
replace seats = 0 in 10
replace treat = 0 in 10


** ISRAEL 1988: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING

drop if partyname == "YA" & countryname == "Israel" & year == 1988

insobs 11, before(1) 

replace countryname = "Israel" in 1/11
replace year = 1988 in 1/11
replace threshold = 1 in 1/11
replace edate = "01nov1988" in 1/11

replace partyname = "Pensioners" in 1
replace votes = 0.73 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "Meimad" in 2
replace votes = 0.69 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "Derekh Aretz" in 3
replace votes = 0.19 in 3
replace seats = 0 in 3
replace treat = 0 in 3

replace partyname = "Or Movement" in 4
replace votes = 0.18 in 4
replace seats = 0 in 4
replace treat = 0 in 4

replace partyname = "Movement for Social Justice" in 5
replace votes = 0.14 in 5
replace seats = 0 in 5
replace treat = 0 in 5

replace partyname = "Yishai – Tribal Israel Together" in 6
replace votes = 0.13 in 6
replace seats = 0 in 6
replace treat = 0 in 6

replace partyname = "Movement for Moshavim" in 7
replace votes = 0.12 in 7
replace seats = 0 in 7
replace treat = 0 in 7

replace partyname = "Tarshish" in 8
replace votes = 0.07 in 8
replace seats = 0 in 8
replace treat = 0 in 8

replace partyname = "Silent Power" in 9
replace votes = 0.07 in 9
replace seats = 0 in 9
replace treat = 0 in 9

replace partyname = "Movement for Demobilised Soldiers" in 9
replace votes = 0.04 in 9
replace seats = 0 in 9
replace treat = 0 in 9

replace partyname = "Yemenite Association" in 10
replace votes = 0.04 in 10
replace seats = 0 in 10
replace treat = 0 in 10

replace partyname = "Unity" in 11
replace votes = 0.02 in 11
replace seats = 0 in 11
replace treat = 0 in 11


** ISRAEL 1992: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING
insobs 13, before(1) 

replace countryname = "Israel" in 1/13
replace year = 1992 in 1/13
replace threshold = 1.5 in 1/13
replace edate = "23jun1992" in 1/13

replace partyname = "New Liberal Party" in 1
replace votes = 0.64 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "Geulat Yisrael" in 2
replace votes = 0.49 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "Da" in 3
replace votes = 0.45 in 3
replace seats = 0 in 3
replace treat = 0 in 3

replace partyname = "Pensioners, Immigrants and Senior Citizens" in 4
replace votes = 0.32 in 4
replace seats = 0 in 4
replace treat = 0 in 4

replace partyname = "Movement for Mortgage Affected, Homeless and Demobilised Soldiers" in 5
replace votes = 0.23 in 5
replace seats = 0 in 5
replace treat = 0 in 5

replace partyname = "Pikanti" in 6
replace votes = 0.14 in 6
replace seats = 0 in 6
replace treat = 0 in 6

replace partyname = "Torah VeAretz" in 7
replace votes = 0.14 in 7
replace seats = 0 in 7
replace treat = 0 in 7

replace partyname = "On Wheels" in 8
replace votes = 0.13 in 8
replace seats = 0 in 8
replace treat = 0 in 8

replace partyname = "Women's Party" in 9
replace votes = 0.11 in 9
replace seats = 0 in 9
replace treat = 0 in 9

replace partyname = "Women's Party" in 9
replace votes = 0.11 in 9
replace seats = 0 in 9
replace treat = 0 in 9

replace partyname = "Hatikva" in 10
replace votes = 0.08 in 10
replace seats = 0 in 10
replace treat = 0 in 10

replace partyname = "Natural Law Party" in 11
replace votes = 0.07 in 11
replace seats = 0 in 11
replace treat = 0 in 11

replace partyname = "Tali" in 12
replace votes = 0.05 in 12
replace seats = 0 in 12
replace treat = 0 in 12

replace partyname = "Tzipor" in 13
replace votes = 0.02 in 13
replace seats = 0 in 13
replace treat = 0 in 13

** ISRAEL 1996: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING

* Dropping a few seemingly wrong parties
drop if partyname == "Gil" & countryname == "Israel" & year == 1996
drop if partyname == "PLP" & countryname == "Israel" & year == 1996

insobs 9, before(1) 

replace countryname = "Israel" in 1/9
replace year = 1996 in 1/9
replace threshold = 1.5 in 1/9
replace edate = "29may1996" in 1/9

replace partyname = "Unity for the Defence of New Immigrants	" in 1
replace votes = 0.75 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "Gil" in 2
replace votes = 0.49 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "Progressive Confederation" in 3
replace votes = 0.46 in 3
replace seats = 0 in 3
replace treat = 0 in 3

replace partyname = "Telem Emuna" in 4
replace votes = 0.42 in 4
replace seats = 0 in 4
replace treat = 0 in 4

replace partyname = "Settlement Party" in 5
replace votes = 0.18 in 5
replace seats = 0 in 5
replace treat = 0 in 5

replace partyname = "Yamin Yisrael" in 6
replace votes = 0.09 in 6
replace seats = 0 in 6
replace treat = 0 in 6

replace partyname = "Man's Rights in the Family Party" in 7
replace votes = 0.08 in 7
replace seats = 0 in 7
replace treat = 0 in 7

replace partyname = "Ta'al" in 8
replace votes = 0.07 in 8
replace seats = 0 in 8
replace treat = 0 in 8

replace partyname = "Da'am Workers Party" in 9
replace votes = 0.04 in 9
replace seats = 0 in 9
replace treat = 0 in 9

* Note: I don't update Israel 2006 because it has 4 closest parties to threshold, which is all we analyze
** ISRAEL 2003: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING
insobs 12, before(1) 

replace countryname = "Israel" in 1/12
replace year = 2003 in 1/12
replace threshold = 1.5 in 1/12
replace edate = "28jan2003" in 1/12

replace partyname = "Progressive National Alliance" in 1
replace votes = 0.65 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "The Greens" in 2
replace votes = 0.41 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "Yisrael Aheret" in 3
replace votes = 0.23 in 3
replace seats = 0 in 3
replace treat = 0 in 3

replace partyname = "Ahavat Yisrael" in 4
replace votes = 0.45 in 4
replace seats = 0 in 4
replace treat = 0 in 4

replace partyname = "Tzomet" in 5
replace votes = 0.06 in 5
replace seats = 0 in 5
replace treat = 0 in 5

replace partyname = "Centre Party" in 6
replace votes = 0.06 in 6
replace seats = 0 in 6
replace treat = 0 in 6

replace partyname = "Da'am Workers Party" in 7
replace votes = 0.06 in 7
replace seats = 0 in 7
replace treat = 0 in 7

replace partyname = "Citizen and State" in 8
replace votes = 0.05 in 8
replace seats = 0 in 8
replace treat = 0 in 8

replace partyname = "Man's Rights in the Family Party" in 9
replace votes = 0.04 in 9
replace seats = 0 in 9
replace treat = 0 in 9

replace partyname = "Lahava" in 10
replace votes = 0.04 in 10
replace seats = 0 in 10
replace treat = 0 in 10

replace partyname = "Za'am" in 11
replace votes = 0.03 in 11
replace seats = 0 in 11
replace treat = 0 in 11

replace partyname = "Leader" in 12
replace votes = 0.03 in 12
replace seats = 0 in 12
replace treat = 0 in 12

** ISRAEL 2006: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING
insobs 16, before(1) 

replace countryname = "Israel" in 1/16
replace year = 2006 in 1/16
replace threshold = 2 in 1/16
replace edate = "28mar2006" in 1/16

replace partyname = "Green Party" in 1
replace votes = 1.52 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "Jewish National Front" in 2
replace votes = 0.79 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "Tafnit" in 3
replace votes = 0.60 in 3
replace seats = 0 in 3
replace treat = 0 in 3

replace partyname = "Atid Ehad" in 4
replace votes = 0.45 in 4
replace seats = 0 in 4
replace treat = 0 in 4

replace partyname = "Hetz" in 5
replace votes = 0.32 in 5
replace seats = 0 in 5
replace treat = 0 in 5

replace votes = 0.15 if partyname == "SHINUI (JS)" & countryname == "Israel" & year == 2006

replace partyname = "Justice for All" in 6
replace votes = 0.12 in 6
replace seats = 0 in 6
replace treat = 0 in 6

replace partyname = "Da'am Workers Party" in 7
replace votes = 0.12 in 7
replace seats = 0 in 7
replace treat = 0 in 7

replace partyname = "Herut – The National Movement" in 8
replace votes = 0.08 in 8
replace seats = 0 in 8
replace treat = 0 in 8

replace partyname = "Leader" in 9
replace votes = 0.02 in 9
replace seats = 0 in 9
replace treat = 0 in 9

replace partyname = "Brit Olam" in 10
replace votes = 0.06 in 10
replace seats = 0 in 10
replace treat = 0 in 10

replace partyname = "Lev" in 11
replace votes = 0.06 in 11
replace seats = 0 in 11
replace treat = 0 in 11

replace partyname = "Lehem" in 12
replace votes = 0.04 in 12
replace seats = 0 in 12
replace treat = 0 in 12

replace partyname = "Tzomet" in 13
replace votes = 0.04 in 13
replace seats = 0 in 13
replace treat = 0 in 13

replace partyname = "The New Zionism" in 14
replace votes = 0.04 in 14
replace seats = 0 in 14
replace treat = 0 in 14

replace partyname = "Oz LaAniyim" in 15
replace votes = 0.04 in 15
replace seats = 0 in 15
replace treat = 0 in 15

replace partyname = "Arab National Party" in 16
replace votes = 0.02 in 16
replace seats = 0 in 16
replace treat = 0 in 16

** ISRAEL 2009: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING
* Drop a wrong party
drop if partyname == "Gil" & countryname == "Israel" & year == 2009

insobs 20, before(1) 


replace countryname = "Israel" in 1/20
replace year = 2009 in 1/20
replace threshold = 2 in 1/20
replace edate = "10feb2009" in 1/20


replace partyname = "The Green Movement–Meimad" in 1
replace votes = 0.82 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "Gil" in 2
replace votes = 0.52 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "The Greens" in 3
replace votes = 0.52 in 3
replace seats = 0 in 3
replace treat = 0 in 3

replace partyname = "Yisrael Hazaka" in 4
replace votes = 0.20 in 4
replace seats = 0 in 4
replace treat = 0 in 4

replace partyname = "Tzabar" in 5
replace votes = 0.14 in 5
replace seats = 0 in 5
replace treat = 0 in 5

replace partyname = "Koah LeHashpi'a" in 6
replace votes = 0.11 in 6
replace seats = 0 in 6
replace treat = 0 in 6

replace partyname = "Da'am Workers Party" in 7
replace votes = 0.08 in 7
replace seats = 0 in 7
replace treat = 0 in 7

replace partyname = "Yisrael HaMithadeshet" in 8
replace votes = 0.08 in 8
replace seats = 0 in 8
replace treat = 0 in 8

replace partyname = "Holocaust Survivors and Ale Yarok Alumni" in 9
replace votes = 0.07 in 9
replace seats = 0 in 9
replace treat = 0 in 9

replace partyname = "Leader" in 10
replace votes = 0.06 in 10
replace seats = 0 in 10
replace treat = 0 in 10

replace partyname = "Tzomet" in 11
replace votes = 0.05 in 11
replace seats = 0 in 11
replace treat = 0 in 11

replace partyname = "Koah HaKesef" in 12
replace votes = 0.03 in 12
replace seats = 0 in 12
replace treat = 0 in 12

replace partyname = "Man's Rights in the Family Party" in 13
replace votes = 0.03 in 13
replace seats = 0 in 13
replace treat = 0 in 13

replace partyname = "HaYisraelim" in 14
replace votes = 0.03 in 14
replace seats = 0 in 14
replace treat = 0 in 14

replace partyname = "Or" in 15
replace votes = 0.02 in 15
replace seats = 0 in 15
replace treat = 0 in 15

replace partyname = "Ahrayut" in 16
replace votes = 0.02 in 16
replace seats = 0 in 16
replace treat = 0 in 16

replace partyname = "Brit Olam" in 17
replace votes = 0.02 in 17
replace seats = 0 in 17
replace treat = 0 in 17

replace partyname = "Lev LaOlim" in 18
replace votes = 0.02 in 18
replace seats = 0 in 18
replace treat = 0 in 18 

replace partyname = "Lazuz" in 19
replace votes = 0.02 in 19
replace seats = 0 in 19
replace treat = 0 in 19

replace partyname = "Lehem" in 20
replace votes = 0.02 in 20
replace seats = 0 in 20
replace treat = 0 in 20

** LITHUANIA 2000: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING

insobs 1, before(1)

replace countryname = "Lithuania" in 1
replace year = 2000 in 1
replace threshold = 3 in 1
replace edate = "29mar2009" in 1

replace partyname = "Lithuanian Party Social Democracy – 2000" in 1
replace votes = 0.49 in 1
replace seats = 0 in 1
replace treat = 0 in 1

** MONTENEGRO 2006: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING


insobs 8, before(1)

replace countryname = "Montenegro" in 1/8
replace year = 2006 in 1/8
replace threshold = 3 in 1/8
replace edate = "10sep2006" in 1/8

replace partyname = "DSCG–PDP Coalition" in 1
replace votes = 1.29 in 1
replace seats = 1 in 1
replace treat = 1 in 1

replace partyname = "Democratic Union of Albanians" in 2
replace votes = 1.09 in 2
replace seats = 1 in 2
replace treat = 1 in 2

replace partyname = "Civic List" in 3
replace votes = 0.86 in 3
replace seats = 0 in 3
replace treat = 0 in 3

replace partyname = "Communists of Montenegro" in 4
replace votes = 0.69 in 4
replace seats = 0 in 4
replace treat = 0 in 4

replace partyname = "New Democratic Force" in 5
replace votes = 0.65 in 5
replace seats = 0 in 5
replace treat = 0 in 5

replace partyname = "Democratic Party of Montenegro" in 6
replace votes = 0.38 in 6
replace seats = 0 in 6
replace treat = 0 in 6

replace partyname = "SNP–NS–DSS" in 7
replace votes = 14.07 in 7
replace seats = 11 in 7
replace treat = 1 in 7

replace partyname = "Albanian Alternative" in 8
replace votes = 0.78 in 8
replace seats = 1 in 8
replace treat = 1 in 8


** MONTENEGRO 2009: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING

drop if partyname == "LPCG" & countryname == "Montenegro" & year == 2009

insobs 7, before(1)

replace countryname = "Montenegro" in 1/7
replace year = 2009 in 1/7
replace threshold = 3 in 1/7
replace edate = "29mar2009" in 1/7

replace partyname = "People's Coalition (NS–DSS)" in 1
replace votes = 2.92 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "Party of United Pensioners and the Disabled" in 2
replace votes = 2.37 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "Serb National List (SSR–SSN)" in 3
replace votes = 1.32 in 3
replace seats = 0 in 3
replace treat = 0 in 3

replace partyname = "Bosniaks and Muslims, Together as One" in 4
replace votes = 1.07 in 4
replace seats = 0 in 4
replace treat = 0 in 4

replace partyname = "Serb Fatherland Party" in 1
replace votes = 0.75 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "Montenegrin Communists" in 1
replace votes = 0.49 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "Party of Democratic Prosperity" in 1
replace votes = 0.25 in 1
replace seats = 0 in 1
replace treat = 0 in 1

** MONTENEGRO 2012: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING

drop if partyname == "Montenegro: Serb Unity" & countryname == "Montenegro" & year == 2012
drop if partyname == "Montenegro: For Unity" & countryname == "Montenegro" & year == 2012
drop if partyname == "Montenegro: Serb National Alliance" & countryname == "Montenegro" & year == 2012
drop if partyname == "Montenegro: Democratic Union of Albanians" & countryname == "Montenegro" & year == 2012
drop if partyname == "Montenegro: Together" & countryname == "Montenegro" & year == 2012
drop if partyname == "Montenegro: Albanian Youth Alliance" & countryname == "Montenegro" & year == 2012

insobs 5, before(1)

replace countryname = "Montenegro" in 1/5
replace year = 2012 in 1/5
replace threshold = 3 in 1/5
replace edate = "14oct2012" in 1/5

replace partyname = "Serb Unity (NS–SL–DCB)" in 1
replace votes = 1.48 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "Serb National Alliance (DSS–SSR)" in 2
replace votes = 0.86 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "Democratic Union of Albanians" in 3
replace votes = 0.80 in 3
replace seats = 0 in 3
replace treat = 0 in 3

replace partyname = "Together (JKP–PUPI)" in 4
replace votes = 0.39 in 4
replace seats = 0 in 4
replace treat = 0 in 4

replace partyname = "Albanian Youth League" in 5
replace votes = 0.15 in 5
replace seats = 0 in 5
replace treat = 0 in 5


** NETHERLANDS 1946: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING

insobs 1, before(1)

replace countryname = "Netherlands" in 1
replace year = 1946 in 1
replace threshold = 1 in 1
replace edate = "17may1946" in 1

replace partyname = "Lopes List" in 1
replace votes = 0.12 in 1
replace seats = 0 in 1
replace treat = 0 in 1

** NETHERLANDS 1948: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING

insobs 1, before(1)

replace countryname = "Netherlands" in 1
replace year = 1948 in 1
replace threshold = 1 in 1
replace edate = "07jul1948" in 1

replace partyname = "Revolutionary Communist Party" in 1
replace votes = 0.05 in 1
replace seats = 0 in 1
replace treat = 0 in 1

** NETHERLANDS 1963: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING

insobs 1, before(1)

replace countryname = "Netherlands" in 1
replace year = 1963 in 1
replace threshold = 0.67 in 1
replace edate = "15may1963" in 1

replace partyname = "Liberal Union–Safe Traffic and 100,100 Houses Each Year" in 1
replace votes = 0.34 in 1
replace seats = 0 in 1
replace treat = 0 in 1

** NETHERLANDS 1989: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING

insobs 13, before(1)

replace countryname = "Netherlands" in 1/13
replace year = 1989 in 1/13
replace threshold = 0.67 in 1/13
replace edate = "06sep1989" in 1/13

replace partyname = "Women's Party" in 1
replace votes = 0.14 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "Elderly Central" in 2
replace votes = 0.09 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "League of Communists in the Netherlands" in 3
replace votes = 0.08 in 3
replace seats = 0 in 3
replace treat = 0 in 3

replace partyname = "Realistic Netherlands" in 4
replace votes = 0.07 in 4
replace seats = 0 in 4
replace treat = 0 in 4

replace partyname = "Socialist Workers' Party" in 4
replace votes = 0.05 in 4
replace treat = 0 in 4

replace partyname = "Anti Unemployment Party" in 5
replace votes = 0.02 in 5
replace seats = 0 in 5
replace treat = 0 in 5

replace partyname = "Political Party for the Elderly" in 6
replace votes = 0.02 in 6
replace seats = 0 in 6
replace treat = 0 in 6

replace partyname = "Progressive Minorities Party" in 7
replace votes = 0.02 in 7
replace seats = 0 in 7
replace treat = 0 in 7

replace partyname = "Party of Democratic Socialists" in 8
replace votes = 0.01 in 8
replace seats = 0 in 8
replace treat = 0 in 8

replace partyname = "Socialist Minority Party" in 9
replace votes = 0.0 in 9
replace seats = 0 in 9
replace treat = 0 in 9

replace partyname = "Humanist Party" in 10
replace votes = 0.0 in 10
replace seats = 0 in 10
replace treat = 0 in 10

replace partyname = "Environmental Defence Party 2000+" in 11
replace votes = 0.0 in 11
replace seats = 0 in 11
replace treat = 0 in 11

replace partyname = "Great Alliance Party" in 12
replace votes = 0.0 in 12
replace seats = 0 in 12
replace treat = 0 in 12

replace partyname = "Constitutional Federation" in 13
replace votes = 0.0 in 13
replace seats = 0 in 13
replace treat = 0 in 13

** NETHERLANDS 1994: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING

insobs 11, before(1)

replace countryname = "Netherlands" in 1/11
replace year = 1994 in 1/11
replace threshold = 0.67 in 1/11
replace edate = "03may1994" in 1/11

replace partyname = "Centre Party '86" in 1
replace votes = 0.36 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "Free Indian Party" in 2
replace votes = 0.19 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "New Communist Party of the Netherlands" in 3
replace votes = 0.13 in 3
replace seats = 0 in 3
replace treat = 0 in 3

replace partyname = "Solidarity Farmers' Party" in 4
replace votes = 0.10 in 4
replace seats = 0 in 4
replace treat = 0 in 4

replace partyname = "Party for Environment and Justice" in 4
replace votes = 0.10 in 4
replace treat = 0 in 4

replace partyname = "Solidarity '93" in 5
replace votes = 0.09 in 5
replace seats = 0 in 5
replace treat = 0 in 5

replace partyname = "Pacifist Socialist Party '92" in 6
replace votes = 0.08 in 6
replace seats = 0 in 6
replace treat = 0 in 6

replace partyname = "The New Party" in 7
replace votes = 0.08 in 7
replace seats = 0 in 7
replace treat = 0 in 7

replace partyname = "General Democratic Party" in 8
replace votes = 0.06 in 8
replace seats = 0 in 8
replace treat = 0 in 8

replace partyname = "Patriotic Democratic Appeal" in 9
replace votes = 0.05 in 9
replace seats = 0 in 9
replace treat = 0 in 9

replace partyname = "Socialist Alternative Politics" in 10
replace votes = 0.05 in 10
replace seats = 0 in 10
replace treat = 0 in 10

replace partyname = "Libertarian Party" in 11
replace votes = 0.03 in 11
replace seats = 0 in 11
replace treat = 0 in 11


** NETHERLANDS 1998: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING

insobs 8, before(1)

replace countryname = "Netherlands" in 1/8
replace year = 1998 in 1/8
replace threshold = 0.67 in 1/8
replace edate = "06may1998" in 1/8

replace partyname = "Mobile Netherlands" in 1
replace votes = 0.53 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "Seniors 2000" in 2
replace votes = 0.42 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "The Greens" in 3
replace votes = 0.18 in 3
replace seats = 0 in 3
replace treat = 0 in 3

replace partyname = "Catholic Political Party" in 4
replace votes = 0.10 in 4
replace seats = 0 in 4
replace treat = 0 in 4

replace partyname = "Free Indian Party" in 4
replace votes = 0.08 in 4
replace treat = 0 in 4

replace partyname = "New Solidarity Elderly Union" in 5
replace votes = 0.07 in 5
replace seats = 0 in 5
replace treat = 0 in 5

replace partyname = "New Communist Party of the Netherlands" in 6
replace votes = 0.07 in 6
replace seats = 0 in 6
replace treat = 0 in 6

replace partyname = "Idealists/Jij" in 7
replace votes = 0.03 in 7
replace seats = 0 in 7
replace treat = 0 in 7

replace partyname = "The Voters Collective" in 8
replace votes = 0.02 in 8
replace seats = 0 in 8
replace treat = 0 in 8


** NETHERLANDS 2002: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING

drop if partyname == "Natuurwetpartij" & countryname == "Netherlands" & year == 2002
drop if partyname == "Nederlandse Middenstandspartij" & countryname == "Netherlands" & year == 2002

insobs 4, before(1)

replace countryname = "Netherlands" in 1/4
replace year = 2002 in 1/4
replace threshold = 0.67 in 1/4
replace edate = "15may2002" in 1/4

replace partyname = "Durable Netherlands" in 1
replace votes = 0.10 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "Party of the Future" in 2
replace votes = 0.07 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "New Middle Party" in 3
replace votes = 0.02 in 3
replace seats = 0 in 3
replace treat = 0 in 3

replace partyname = "Republican People's Party" in 4
replace votes = 0 in 4
replace seats = 0 in 4
replace treat = 0 in 4

** NETHERLANDS 2003: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING

drop if partyname == "Natuurwetpartij" & countryname == "Netherlands" & year == 2003

insobs 8, before(1)

replace countryname = "Netherlands" in 1/8
replace year = 2003 in 1/8
replace threshold = 0.67 in 1/8
replace edate = "22jan2003" in 1/8

replace partyname = "Party of the Future" in 1
replace votes = 0.14 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "Ratelband List" in 2
replace votes = 0.09 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "Durable Netherlands" in 3
replace votes = 0.08 in 3
replace seats = 0 in 3
replace treat = 0 in 3

replace partyname = "New Communist Party of the Netherlands" in 4
replace votes = 0.05 in 4
replace seats = 0 in 4
replace treat = 0 in 4

replace partyname = "Conservatieven.nl" in 5
replace votes = 0.03 in 5
replace seats = 0 in 5
replace treat = 0 in 5

replace partyname = "Progressive Integration Party" in 6
replace votes = 0.03 in 6
replace seats = 0 in 6
replace treat = 0 in 6

replace partyname = "Alliance for Renewal and Democracy" in 7
replace votes = 0.03 in 7
replace seats = 0 in 7
replace treat = 0 in 7

replace partyname = "Veldhoen List" in 8
replace votes = 0.0 in 8
replace seats = 0 in 8
replace treat = 0 in 8


** NETHERLANDS 2006: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING

drop if partyname == "Natuurwetpartij" & countryname == "Netherlands" & year == 2006

insobs 11, before(1)

replace countryname = "Netherlands" in 1/11
replace year = 2006 in 1/11
replace threshold = 0.67 in 1/11
replace edate = "22nov2006" in 1/11

replace partyname = "Ad Bos Collective" in 1
replace votes = 0.05 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "Party for the Netherlands" in 2
replace votes = 0.05 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "Islam Democrats" in 3
replace votes = 0.04 in 3
replace seats = 0 in 3
replace treat = 0 in 3

replace partyname = "Netherlands Transparent" in 4
replace votes = 0.02 in 4
replace seats = 0 in 4
replace treat = 0 in 4

replace partyname = "Green Free! Internet Party" in 5
replace votes = 0.02 in 5
replace seats = 0 in 5
replace treat = 0 in 5

replace partyname = "Liberal Democratic Party" in 6
replace votes = 0.02 in 6
replace seats = 0 in 6
replace treat = 0 in 6

replace partyname = "Poortman List" in 7
replace votes = 0.02 in 7
replace seats = 0 in 7
replace treat = 0 in 7

replace partyname = "Continuous Direct Democracy Party" in 8
replace votes = 0.01 in 8
replace seats = 0 in 8
replace treat = 0 in 8

replace partyname = "LRVP - hetZeteltje" in 9
replace votes = 0.0 in 9
replace seats = 0 in 9
replace treat = 0 in 9

replace partyname = "Solid Multicultural Party" in 10
replace votes = 0.0 in 10
replace seats = 0 in 10
replace treat = 0 in 10

replace partyname = "Tamara's Open Party" in 11
replace votes = 0.0 in 11
replace seats = 0 in 11
replace treat = 0 in 11


** NETHERLANDS 2010: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING

insobs 6, before(1)

replace countryname = "Netherlands" in 1/6
replace year = 2010 in 1/6
replace threshold = 0.67 in 1/6
replace edate = "09jun2010" in 1/6

replace partyname = "Party for Human and Spirit" in 1
replace votes = 0.28 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "Pirate Party" in 2
replace votes = 0.11 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "List 17 / Feijen List" in 3
replace votes = 0.08 in 3
replace seats = 0 in 3
replace treat = 0 in 3

replace partyname = "Partij één" in 4
replace votes = 0.02 in 4
replace seats = 0 in 4
replace treat = 0 in 4

replace partyname = "New Netherlands" in 5
replace votes = 0.02 in 5
replace seats = 0 in 5
replace treat = 0 in 5

replace partyname = "Evangelical Party Netherlands" in 6
replace votes = 0.01 in 6
replace seats = 0 in 6
replace treat = 0 in 6

** NORWAY 1989: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING

drop if partyname == "Liberal Party (Venstre)" & countryname == "Norway" & year == 1989

insobs 7, before(1)

replace countryname = "Norway" in 1/7
replace year = 1989 in 1/7
replace threshold = 4 in 1/7
replace edate = "10sep1989" in 1/7

replace partyname = "County Lists for Environment and Solidarity" in 1
replace votes = 0.8 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "Environment Party The Greens" in 2
replace votes = 0.4 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "Stop Immigration" in 3
replace votes = 0.3 in 3
replace seats = 0 in 3
replace treat = 0 in 3

replace partyname = "Future for Finnmark" in 4
replace votes = 0.3 in 4
replace seats = 0 in 4
replace treat = 0 in 4

replace partyname = "Pensioners' Party" in 5
replace votes = 0.3 in 5
replace seats = 0 in 5
replace treat = 0 in 5

replace partyname = "Liberals - Europe Party" in 6
replace votes = 0.0 in 6
replace seats = 0 in 6
replace treat = 0 in 6

replace partyname = "Common Future" in 7
replace votes = 0.0 in 7
replace seats = 0 in 7
replace treat = 0 in 7

** NORWAY 1993: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING

insobs 11, before(1)

replace countryname = "Norway" in 1/11
replace year = 1993 in 1/11
replace threshold = 4 in 1/11
replace edate = "13sep1993" in 1/11

replace partyname = "Fatherland Party" in 1
replace votes = 0.5 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "New Future Coalition Party" in 2
replace votes = 0.4 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "Christian Conservative Party" in 3
replace votes = 0.1 in 3
replace seats = 0 in 3
replace treat = 0 in 3

replace partyname = "Stop Immigration" in 4
replace votes = 0.3 in 4
replace seats = 0 in 4
replace treat = 0 in 4

replace partyname = "Natural Law Party" in 5
replace votes = 0.1 in 5
replace seats = 0 in 5
replace treat = 0 in 5

replace partyname = "Freedom Party against the EF Union" in 6
replace votes = 0.0 in 6
replace seats = 0 in 6
replace treat = 0 in 6

replace partyname = "Liberal People's Party" in 7
replace votes = 0.0 in 7
replace seats = 0 in 7
replace treat = 0 in 7

replace partyname = "Common Future" in 8
replace votes = 0.0 in 8
replace seats = 0 in 8
replace treat = 0 in 8

replace partyname = "Communist Party" in 9
replace votes = 0.0 in 9
replace seats = 0 in 9
replace treat = 0 in 9

replace partyname = "Society Party" in 10
replace votes = 0.0 in 10
replace seats = 0 in 10
replace treat = 0 in 10

replace partyname = "Coalition Common list against foreign immigration" in 11
replace votes = 0.2 in 11
replace seats = 0 in 11
replace treat = 0 in 11

** NORWAY 1997: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING

insobs 11, before(1)

replace countryname = "Norway" in 1/11
replace year = 1997 in 1/11
replace threshold = 4 in 1/11
replace edate = "15sep1997" in 1/11

replace partyname = "Pensioners' Party" in 1
replace votes = 0.6 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "Fatherland Party" in 2
replace votes = 0.2 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "Natural Law Party" in 3
replace votes = 0.1 in 3
replace seats = 0 in 3
replace treat = 0 in 3

replace partyname = "Communist Party" in 4
replace votes = 0.1 in 4
replace seats = 0 in 4
replace treat = 0 in 4

replace partyname = "Christian Conservative Party" in 5
replace votes = 0.1 in 5
replace seats = 0 in 5
replace treat = 0 in 5

replace partyname = "New Future Coalition Party" in 6
replace votes = 0.0 in 6
replace seats = 0 in 6
replace treat = 0 in 6

replace partyname = "White Electoral Alliance" in 7
replace votes = 0.0 in 7
replace seats = 0 in 7
replace treat = 0 in 7

replace partyname = "Justice Party" in 8
replace votes = 0.0 in 8
replace seats = 0 in 8
replace treat = 0 in 8

replace partyname = "Liberal People's Party" in 9
replace votes = 0.0 in 9
replace seats = 0 in 9
replace treat = 0 in 9

replace partyname = "Children-Elderly" in 10
replace votes = 0.0 in 10
replace seats = 0 in 10
replace treat = 0 in 10

replace partyname = "Society Party" in 11
replace votes = 0.2 in 11
replace seats = 0 in 11
replace treat = 0 in 11

** NORWAY 2001: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING

drop if partyname == "Interpolitical People's party" & countryname == "Norway" & year == 2001

insobs 11, before(1)

replace countryname = "Norway" in 1/11
replace year = 2001 in 1/11
replace threshold = 4 in 1/11
replace edate = "09sep2001" in 1/11

replace partyname = "Pensioners' Party" in 1
replace votes = 0.6 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "The Political Party" in 2
replace votes = 0.8 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "Pensioners' Party" in 3
replace votes = 0.7 in 3
replace seats = 0 in 3
replace treat = 0 in 3

replace partyname = "Christian Unity Party" in 4
replace votes = 0.3 in 4
replace seats = 0 in 4
replace treat = 0 in 4

replace partyname = "Fatherland Party" in 5
replace votes = 0.1 in 5
replace seats = 0 in 5
replace treat = 0 in 5

replace partyname = "Communist Party" in 6
replace votes = 0.1 in 6
replace seats = 0 in 6
replace treat = 0 in 6

replace partyname = "Norwegian People's Party" in 7
replace votes = 0.1 in 7
replace seats = 0 in 7
replace treat = 0 in 7

replace partyname = "Non-Partisan Coastal and Rural District Party" in 8
replace votes = 0.0 in 8
replace seats = 0 in 8
replace treat = 0 in 8

replace partyname = "Social Democrats" in 9
replace votes = 0.0 in 9
replace seats = 0 in 9
replace treat = 0 in 9

replace partyname = "Natural Law Party" in 10
replace votes = 0.0 in 10
replace seats = 0 in 10
replace treat = 0 in 10

replace partyname = "Liberal People's Party" in 11
replace votes = 0 in 11
replace seats = 0 in 11
replace treat = 0 in 11

** NORWAY 2005: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING

insobs 11, before(1)

replace countryname = "Norway" in 1/11
replace year = 2005 in 1/11
replace threshold = 4 in 1/11
replace edate = "11sep2005" in 1/11

replace partyname = "Pensioners' Party" in 1
replace votes = 0.5 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "Christian Unity Party" in 2
replace votes = 0.1 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "Democrats" in 3
replace votes = 0.1 in 3
replace seats = 0 in 3
replace treat = 0 in 3

replace partyname = "Abortion Opponents' List" in 4
replace votes = 0.1 in 4
replace seats = 0 in 4
replace treat = 0 in 4

replace partyname = "Communist Party" in 5
replace votes = 0 in 5
replace seats = 0 in 5
replace treat = 0 in 5

replace partyname = "Reform Party" in 6
replace votes = 0 in 6
replace seats = 0 in 6
replace treat = 0 in 6

replace partyname = "Sami People's Party" in 7
replace votes = 0 in 7
replace seats = 0 in 7
replace treat = 0 in 7

replace partyname = "Liberal People's Party" in 8
replace votes = 0.0 in 8
replace seats = 0 in 8
replace treat = 0 in 8

replace partyname = "Norwegian Republican Alliance" in 9
replace votes = 0.0 in 9
replace seats = 0 in 9
replace treat = 0 in 9

replace partyname = "Beer Unity Party" in 10
replace votes = 0.0 in 10
replace seats = 0 in 10
replace treat = 0 in 10

replace partyname = "Society Party" in 11
replace votes = 0 in 11
replace seats = 0 in 11
replace treat = 0 in 11

** NORWAY 2009: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING

drop if partyname == "Interpolitical People's party" & countryname == "Norway" & year == 2009
insobs 14, before(1)

replace countryname = "Norway" in 1/14
replace year = 2009 in 1/14
replace threshold = 4 in 1/14
replace edate = "13sep2009" in 1/14

replace partyname = "Pensioners' Party" in 1
replace votes = 0.4 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "Christian Unity Party (Kristent Samlingsparti) " in 2
replace votes = 0.2 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "Democrats" in 3
replace votes = 0.1 in 3
replace seats = 0 in 3
replace treat = 0 in 3

replace partyname = "Communist Party of Norway" in 4
replace votes = 0 in 4
replace seats = 0 in 4
replace treat = 0 in 4

replace partyname = "Liberal People's Party" in 5
replace votes = 0 in 5
replace seats = 0 in 5
replace treat = 0 in 5

replace partyname = "Contemporary Party" in 6
replace votes = 0 in 6
replace seats = 0 in 6
replace treat = 0 in 6

replace partyname = "Center Alliance" in 7
replace votes = 0 in 7
replace seats = 0 in 7
replace treat = 0 in 7

replace partyname = "Norwegian Patriots" in 8
replace votes = 0.0 in 8
replace seats = 0 in 8
replace treat = 0 in 8

replace partyname = "Vigrid" in 9
replace votes = 0.0 in 9
replace seats = 0 in 9
replace treat = 0 in 9

replace partyname = "Abortion Opponents' List" in 10
replace votes = 0.0 in 10
replace seats = 0 in 10
replace treat = 0 in 10

replace partyname = "Society Party" in 11
replace votes = 0 in 11
replace seats = 0 in 11
replace treat = 0 in 11

replace partyname = "One (Written) Language" in 12
replace votes = 0 in 12
replace seats = 0 in 12
replace treat = 0 in 12

replace partyname = "Non-Partisan Deputies" in 13
replace votes = 0 in 13
replace seats = 0 in 13
replace treat = 0 in 13

replace partyname = "Norwegian Republican Alliance" in 14
replace votes = 0 in 14
replace seats = 0 in 14
replace treat = 0 in 14

** POLAND 2001: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING

replace threshold = 5 if countryname == "Poland" & year == 2001
insobs 4, before(1)

replace countryname = "Poland" in 1/4
replace year = 2001 in 1/4
replace threshold = 5 in 1/4
replace edate = "23sep2001" in 1/4

replace partyname = "Social Alternative Movement" in 1
replace votes = 0.42 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "Polish Economic Union" in 2
replace votes = 0.06 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "German Minority Upper Silesia" in 3
replace votes = 0.06 in 3
replace seats = 0 in 3
replace treat = 0 in 3

replace partyname = "Polska Wspólnota Narodowa" in 4
replace votes = 0.02 in 4
replace seats = 0 in 4
replace treat = 0 in 4

** POLAND 2007: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING

insobs 4, before(1)

replace countryname = "Poland" in 1/4
replace year = 2007 in 1/4
replace threshold = 5 in 1/4
replace edate = "21oct2007" in 1/4

replace partyname = "Polish Labour Party" in 1
replace votes = 0.99 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "Women's Party" in 2
replace votes = 0.28 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "German Minority Electoral Committee" in 3
replace votes = 0.28 in 3
replace seats = 0 in 3
replace treat = 0 in 3

replace partyname = "Patriotic Self-Defense" in 4
replace votes = 0.02 in 4
replace seats = 0 in 4
replace treat = 0 in 4

** ROMANIA 2008: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING

insobs 1, before(1)

replace countryname = "Romania" in 1
replace year = 2008 in 1
replace threshold = 5 in 1
replace edate = "30nov2008" in 1

replace partyname = "Party of the Roma Pro Europe" in 1
replace votes = 0.64 in 1
replace seats = 0 in 1
replace treat = 0 in 1

** SOUTH KOREA 1988
drop if countryname == "South Korea" & year == 1988

insobs 14, before(1)

replace countryname = "South Korea" in 1/14
replace year = 1988 in 1/14
replace threshold = 3 in 1/14
replace edate = "26apr1988" in 1/14

replace partyname = "People's Party" in 1
replace votes = 0.33 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "Korean National Party" in 2
replace votes = 0.33 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "New Korea and Democratic Party" in 3
replace votes = 0.24 in 3
replace seats = 0 in 3
replace treat = 0 in 3

replace partyname = "Democratic Korea Party" in 4
replace votes = 0.17 in 4
replace seats = 0 in 4
replace treat = 0 in 4

replace partyname = "Korean Justice Party" in 5
replace votes = 0.13 in 5
replace seats = 0 in 5
replace treat = 0 in 5

replace partyname = "The Third Generation Party" in 6
replace votes = 0.08 in 6
replace seats = 0 in 6
replace treat = 0 in 6

replace partyname = "Hanist Reunification Korean Party" in 7
replace votes = 0.02 in 7
replace seats = 0 in 7
replace treat = 0 in 7

replace partyname = "Unificational Socialist Party" in 8
replace votes = 0.02 in 8
replace seats = 0 in 8
replace treat = 0 in 8

replace partyname = "Christian Holy People's Party" in 9
replace votes = 0.01 in 9
replace seats = 0 in 9
replace treat = 0 in 9

replace partyname = "Democratic Justice Party" in 10
replace votes = 33.96 in 10
replace seats = 125 in 10
replace treat = 1 in 10

replace partyname = "Reunification Democratic Party" in 11
replace votes = 23.83 in 11
replace seats = 59 in 11
replace treat = 1 in 11

replace partyname = "Peace Democratic Party" in 12
replace votes = 19.26 in 12
replace seats = 70 in 12
replace treat = 1 in 12

replace partyname = "New Democratic Republican Party" in 13
replace votes = 15.59 in 13
replace seats = 35 in 13
replace treat = 1 in 13

replace partyname = "Hankyoreh Democratic Party" in 14
replace votes = 1.28 in 14
replace seats = 1 in 14
replace treat = 1 in 14

** SOUTH KOREA 2012: ADD NON PARL PARTIES, CURRENTLY MISSING

insobs 16, before(1)

replace countryname = "South Korea" in 1/16
replace year = 2012 in 1/16
replace threshold = 3 in 1/16
replace edate = "11apr2012" in 1/16

replace partyname = "Christian Party" in 1
replace votes = 1.21 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "New Progressive Party" in 2
replace votes = 1.14 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "Hannara Party" in 3
replace votes = 0.85 in 3
replace seats = 0 in 3
replace treat = 0 in 3

replace partyname = "Korea Vision Party" in 4
replace votes = 0.73 in 4
replace seats = 0 in 4
replace treat = 0 in 4

replace partyname = "Pro-Park United" in 5
replace votes = 0.63 in 5
replace seats = 0 in 5
replace treat = 0 in 5

replace partyname = "Green Party Korea" in 6
replace votes = 0.49 in 6
replace seats = 0 in 6
replace treat = 0 in 6

replace partyname = "Creative Korea Party" in 7
replace votes = 0.43 in 7
replace seats = 0 in 7
replace treat = 0 in 7

replace partyname = "Party for Youth" in 8
replace votes = 0.34 in 8
replace seats = 0 in 8
replace treat = 0 in 8

replace partyname = "Go! Party for the Grand People" in 9
replace votes = 0.28 in 9
replace seats = 0 in 9
replace treat = 0 in 9

replace partyname = "Korean Christian Party" in 10
replace votes = 0.25 in 10
replace seats = 0 in 10
replace treat = 0 in 10

replace partyname = "Authentic Democratic Party" in 11
replace votes = 0.23 in 11
replace seats = 0 in 11
replace treat = 0 in 11

replace partyname = "United Buddhist Party" in 12
replace votes = 0.17 in 12
replace seats = 0 in 12
replace treat = 0 in 12

replace partyname = "People's Happiness Party" in 13
replace votes = 0.17 in 13
replace seats = 0 in 13
replace treat = 0 in 13

replace partyname = "Party for Culture and Art" in 14
replace votes = 0.11 in 14
replace seats = 1 in 14
replace treat = 1 in 14

replace partyname = "Party of Future Union" in 15
replace votes = 0.09 in 15
replace seats = 1 in 15
replace treat = 1 in 15

replace partyname = "Grand Korea Party" in 16
replace votes = 0.07 in 16
replace seats = 1 in 16
replace treat = 1 in 16

** SOUTH KOREA 2016: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING

insobs 18, before(1)

replace countryname = "South Korea" in 1/18
replace year = 2016 in 1/18
replace threshold = 3 in 1/18
replace edate = "13apr2016" in 1/18

replace partyname = "Christian Liberal Party" in 1
replace votes = 2.64 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "Minjoo Party" in 2
replace votes = 0.88 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "Green Party Korea" in 3
replace votes = 0.77 in 3
replace seats = 0 in 3
replace treat = 0 in 3

replace partyname = "People's United Party" in 4
replace votes = 0.61 in 4
replace seats = 0 in 4
replace treat = 0 in 4

replace partyname = "Christian Democratic Party" in 5
replace votes = 0.55 in 5
replace seats = 0 in 5
replace treat = 0 in 5

replace partyname = "Hannara Party" in 6
replace votes = 0.36 in 6
replace seats = 0 in 6
replace treat = 0 in 6

replace partyname = "Labor Party" in 7
replace votes = 0.39 in 7
replace seats = 0 in 7
replace treat = 0 in 7

replace partyname = "Green Buddhist Federation" in 8
replace votes = 0.13 in 8
replace seats = 0 in 8
replace treat = 0 in 8

replace partyname = "Let's Go! Korea" in 9
replace votes = 0.11 in 9
replace seats = 0 in 9
replace treat = 0 in 9

replace partyname = "Let's Go! Peace and Human Rights Party" in 11
replace votes = 0.11 in 11
replace seats = 0 in 11
replace treat = 0 in 11

replace partyname = "Welfare National Party" in 12
replace votes = 0.09 in 12
replace seats = 0 in 12
replace treat = 0 in 12

replace partyname = "United Korean Party" in 13
replace votes = 0.07 in 13
replace seats = 0 in 13
replace treat = 0 in 13

replace partyname = "Korean National Party" in 14
replace votes = 0.07 in 14
replace seats = 0 in 14
replace treat = 0 in 14

replace partyname = "Republican Party" in 15
replace votes = 0.05 in 15
replace seats = 0 in 15
replace treat = 0 in 15

replace partyname = "Employment Welfare Pension Advancement Coalition" in 16
replace votes = 0.05 in 16
replace seats = 0 in 16
replace treat = 0 in 16

replace partyname = "Chinbak Yeondae" in 17
replace votes = 0.05 in 17
replace seats = 0 in 17
replace treat = 0 in 17

replace partyname = "Pro-Ban Unification Party" in 18
replace votes = 0.04 in 18
replace seats = 0 in 18
replace treat = 0 in 18

** SWEDEN 1973: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING

insobs 2, before(1)

replace countryname = "Sweden" in 1/2
replace year = 1973 in 1/2
replace threshold = 4 in 1/2
replace edate = "16sep1973" in 1/2

replace partyname = "Communist Party of Sweden" in 1
replace votes = 0.4 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "Communist League Marxist-Leninist (Revolutionaries)" in 2
replace votes = 0.2 in 2
replace seats = 0 in 2
replace treat = 0 in 2

** SWEDEN 1976: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING

insobs 1, before(1)

replace countryname = "Sweden" in 1
replace year = 1976 in 1
replace threshold = 4 in 1
replace edate = "19sep1976" in 1

replace partyname = "Communist Party of Sweden" in 2
replace votes = 0.3 in 2
replace seats = 0 in 2
replace treat = 0 in 2

** SWEDEN 1979: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING

insobs 2, before(1)

replace countryname = "Sweden" in 1/2
replace year = 1979 in 1/2
replace threshold = 4 in 1/2
replace edate = "16sep1979" in 1/2

replace partyname = "Communist Party of Sweden" in 1
replace votes = 0.2 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "Workers Party Communists" in 2
replace votes = 0.2 in 2
replace seats = 0 in 2
replace treat = 0 in 2

** SWEDEN 1982: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING

insobs 1, before(1)

replace countryname = "Sweden" in 1
replace year = 1982 in 1
replace threshold = 4 in 1
replace edate = "19sep1982" in 1

replace partyname = "Workers Party Communists" in 1
replace votes = 0.1 in 1
replace seats = 0 in 1
replace treat = 0 in 1

** SWEDEN 1985: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING
drop if seats == 0 & countryname == "Sweden" & year == 1985
insobs 2, before(1)

replace countryname = "Sweden" in 1/2
replace year = 1985 in 1/2
replace threshold = 4 in 1/2
replace edate = "15sep1985" in 1/2

replace partyname = "Christian Democratic Unity" in 1
replace votes = 2.4 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "Green Party" in 2
replace votes = 1.5 in 2
replace seats = 0 in 2
replace treat = 0 in 2

** SWEDEN 1998: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING
insobs 9, before(1)

replace countryname = "Sweden" in 1/9
replace year = 1998 in 1/9
replace threshold = 4 in 1/9
replace edate = "20sep1998" in 1/9

replace partyname = "Swedish Senior Citizen Interest Party" in 1
replace votes = 1 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "The New Party" in 2
replace votes = 0.5 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "New Future" in 3
replace votes = 0.2 in 3
replace seats = 0 in 3
replace treat = 0 in 3

replace partyname = "New Democracy" in 4
replace votes = 0.2 in 4
replace seats = 0 in 4
replace treat = 0 in 4

replace partyname = "Senior Citizen Party" in 5
replace votes = 0.1 in 5
replace seats = 0 in 5
replace treat = 0 in 5

replace partyname = "Socialist Justice Party" in 6
replace votes = 0.1 in 6
replace seats = 0 in 6
replace treat = 0 in 6

replace partyname = "Communist Party of Sweden" in 7
replace votes = 0 in 7
replace seats = 0 in 7
replace treat = 0 in 7

replace partyname = "Enhet" in 8
replace votes = 0 in 8
replace seats = 0 in 8
replace treat = 0 in 8

replace partyname = "Socialist Party" in 9
replace votes = 0.5 in 9
replace seats = 0 in 9
replace treat = 0 in 9


** SWEDEN 2002: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING
insobs 10, before(1)

replace countryname = "Sweden" in 1/10
replace year = 2002 in 1/10
replace threshold = 4 in 1/10
replace edate = "15sep2002" in 1/10

replace partyname = "Swedish Senior Citizen Interest Party" in 1
replace votes = 0.71 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "Norrbotten Party" in 2
replace votes = 0.28 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "New Future" in 3
replace votes = 0.18 in 3
replace seats = 0 in 3
replace treat = 0 in 3

replace partyname = "National Democrats" in 4
replace votes = 0.17 in 4
replace seats = 0 in 4
replace treat = 0 in 4

replace partyname = "Skåne Party" in 5
replace votes = 0.09 in 5
replace seats = 0 in 5
replace treat = 0 in 5

replace partyname = "Socialist Party" in 6
replace votes = 0.06 in 6
replace seats = 0 in 6
replace treat = 0 in 6

replace partyname = "Socialist Justice Party" in 7
replace votes = 0.03 in 7
replace seats = 0 in 7
replace treat = 0 in 7

replace partyname = "Communist Party of Sweden" in 8
replace votes = 0.02 in 8
replace seats = 0 in 8
replace treat = 0 in 8

replace partyname = "Unity" in 9
replace votes = 0.01 in 9
replace seats = 0 in 9
replace treat = 0 in 9

replace partyname = "Free List" in 10
replace votes = 0.01 in 10
replace seats = 0 in 10
replace treat = 0 in 10


** SWEDEN 2006: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING
insobs 11, before(1)

replace countryname = "Sweden" in 1/11
replace year = 2006 in 1/11
replace threshold = 4 in 1/11
replace edate = "17sep2006" in 1/11

replace partyname = "Feminist Initiative" in 1
replace votes = 0.68 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "Pirate Party" in 2
replace votes = 0.63 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "Swedish Senior Citizen Interest Party" in 3
replace votes = 0.52 in 3
replace seats = 0 in 3
replace treat = 0 in 3

replace partyname = "June List" in 4
replace votes = 0.47 in 4
replace seats = 0 in 4
replace treat = 0 in 4

replace partyname = "Health Care Party" in 5
replace votes = 0.21 in 5
replace seats = 0 in 5
replace treat = 0 in 5

replace partyname = "National Democrats" in 6
replace votes = 0.06 in 6
replace seats = 0 in 6
replace treat = 0 in 6

replace partyname = "Unity" in 7
replace votes = 0.05 in 7
replace seats = 0 in 7
replace treat = 0 in 7

replace partyname = "National Socialist Front" in 8
replace votes = 0.03 in 8
replace seats = 0 in 8
replace treat = 0 in 8

replace partyname = "New Future" in 9
replace votes = 0.02 in 9
replace seats = 0 in 9
replace treat = 0 in 9

replace partyname = "Socialist Justice Party" in 10
replace votes = 0.02 in 10
replace seats = 0 in 10
replace treat = 0 in 10

replace partyname = "People's Will" in 11
replace votes = 0.02 in 11
replace seats = 0 in 11
replace treat = 0 in 11

** SWEDEN 2010: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING
insobs 11, before(1)

replace countryname = "Sweden" in 1/11
replace year = 2010 in 1/11
replace threshold = 4 in 1/11
replace edate = "19sep2010" in 1/11

replace partyname = "Pirate Party" in 1
replace votes = 0.68 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "Feminist Initiative" in 2
replace votes = 0.40 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "Swedish Senior Citizen Interest Party" in 3
replace votes = 0.19 in 3
replace seats = 0 in 3
replace treat = 0 in 3

replace partyname = "Rural Democrats" in 4
replace votes = 0.03 in 4
replace seats = 0 in 4
replace treat = 0 in 4

replace partyname = "Socialist Justice Party" in 5
replace votes = 0.03 in 5
replace seats = 0 in 5
replace treat = 0 in 5

replace partyname = "Norrland Coalition Party" in 6
replace votes = 0.02 in 6
replace seats = 0 in 6
replace treat = 0 in 6

replace partyname = "National Democrats" in 7
replace votes = 0.02 in 7
replace seats = 0 in 7
replace treat = 0 in 7

replace partyname = "Classical Liberal Party" in 8
replace votes = 0.01 in 8
replace seats = 0 in 8
replace treat = 0 in 8

replace partyname = "Freedom Party" in 9
replace votes = 0.01 in 9
replace seats = 0 in 9
replace treat = 0 in 9

replace partyname = "Party of the Swedes" in 10
replace votes = 0.01 in 10
replace seats = 0 in 10
replace treat = 0 in 10

replace partyname = "Unity" in 11
replace votes = 0.01 in 11
replace seats = 0 in 11
replace treat = 0 in 11


** TAIWAN 2012: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING
insobs 6, before(1)

replace countryname = "Taiwan" in 1/6
replace year = 2012 in 1/6
replace threshold = 5 in 1/6
replace edate = "14jan2012" in 1/6

replace partyname = "Green Party Taiwan" in 1
replace votes = 1.74 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "National Health Service Alliance" in 2
replace votes = 1.24 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "Taiwan National Congress" in 3
replace votes = 0.9 in 3
replace seats = 0 in 3
replace treat = 0 in 3

replace partyname = "People United Party" in 4
replace votes = 0.64 in 4
replace seats = 0 in 4
replace treat = 0 in 4

replace partyname = "Taiwanism Party" in 5
replace votes = 0.23 in 5
replace seats = 0 in 5
replace treat = 0 in 5

replace partyname = "Taiwan Basic Laws Party" in 6
replace votes = 0.15 in 6
replace seats = 0 in 6
replace treat = 0 in 6

** TURKEY 1987: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING
insobs 2, before(1)

replace countryname = "Turkey" in 1/2
replace year = 1987 in 1/2
replace threshold = 10 in 1/2
replace edate = "29nov1987" in 1/2

replace partyname = "Nationalist Workers Party" in 1
replace votes = 2.93 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "Reformist Democracy Party" in 2
replace votes = 0.82 in 2
replace seats = 0 in 2
replace treat = 0 in 2

** TURKEY 1991: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING
insobs 1, before(1)

replace countryname = "Turkey" in 1
replace year = 1991 in 1
replace threshold = 10 in 1
replace edate = "20oct1991" in 1

replace partyname = "Socialist Party" in 1
replace votes = 0.44 in 1
replace seats = 0 in 1
replace treat = 0 in 1


** TURKEY 1995: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING
insobs 5, before(1)

replace countryname = "Turkey" in 1/5
replace year = 1995 in 1/5
replace threshold = 10 in 1/5
replace edate = "24dec1995" in 1/5

replace partyname = "New Democracy Movement" in 1
replace votes = 0.48 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "Nation Party" in 2
replace votes = 0.45 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "Rebirth Party" in 3
replace votes = 0.34 in 3
replace seats = 0 in 3
replace treat = 0 in 3

replace partyname = "Workers' Party" in 4
replace votes = 0.22 in 4
replace seats = 0 in 4
replace treat = 0 in 4

replace partyname = "New Party" in 5
replace votes = 0.13 in 5
replace seats = 0 in 5
replace treat = 0 in 5

** TURKEY 1999: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING
insobs 13, before(1)

replace countryname = "Turkey" in 1/13
replace year = 1999 in 1/13
replace threshold = 10 in 1/13
replace edate = "18apr1999" in 1/13

replace partyname = "Great Unity Party" in 1
replace votes = 1.46 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "Freedom and Solidarity Party" in 2
replace votes = 0.8 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "Democrat Turkey Party" in 3
replace votes = 0.58 in 3
replace seats = 0 in 3
replace treat = 0 in 3

replace partyname = "Liberal Democratic Party" in 4
replace votes = 0.41 in 4
replace seats = 0 in 4
replace treat = 0 in 4

replace partyname = "Democratic Party" in 5
replace votes = 0.3 in 5
replace seats = 0 in 5
replace treat = 0 in 5

replace partyname = "Nation Party" in 6
replace votes = 0.25 in 6
replace seats = 0 in 6
replace treat = 0 in 6

replace partyname = "Peace Party" in 7
replace votes = 0.25 in 7
replace seats = 0 in 7
replace treat = 0 in 7

replace partyname = "Workers' Party" in 8
replace votes = 0.18 in 8
replace seats = 0 in 8
replace treat = 0 in 8

replace partyname = "Labour Party" in 9
replace votes = 0.17 in 9
replace seats = 0 in 9
replace treat = 0 in 9

replace partyname = "Rebirth Party" in 10
replace votes = 0.14 in 10
replace seats = 0 in 10
replace treat = 0 in 10

replace partyname = "Socialist Power Party" in 11
replace votes = 0.12 in 11
replace seats = 0 in 11
replace treat = 0 in 11

replace partyname = "Changing Turkey Party" in 12
replace votes = 0.12 in 12
replace seats = 0 in 12
replace treat = 0 in 12

replace partyname = "Democracy and Peace Party" in 13
replace votes = 0.08 in 13
replace seats = 0 in 13
replace treat = 0 in 13

** TURKEY 2002: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING
insobs 13, before(1)

replace countryname = "Turkey" in 1/13
replace year = 2002 in 1/13
replace threshold = 10 in 1/13
replace edate = "03nov2002" in 1/13

replace partyname = "Great Unity Party" in 1
replace votes = 1.46 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "Freedom and Solidarity Party" in 2
replace votes = 0.8 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "Democrat Turkey Party" in 3
replace votes = 0.58 in 3
replace seats = 0 in 3
replace treat = 0 in 3

replace partyname = "Liberal Democratic Party" in 4
replace votes = 0.41 in 4
replace seats = 0 in 4
replace treat = 0 in 4

replace partyname = "Democratic Party" in 5
replace votes = 0.3 in 5
replace seats = 0 in 5
replace treat = 0 in 5

replace partyname = "Nation Party" in 6
replace votes = 0.25 in 6
replace seats = 0 in 6
replace treat = 0 in 6

replace partyname = "Peace Party" in 7
replace votes = 0.25 in 7
replace seats = 0 in 7
replace treat = 0 in 7

replace partyname = "Workers' Party" in 8
replace votes = 0.18 in 8
replace seats = 0 in 8
replace treat = 0 in 8

replace partyname = "Labour Party" in 9
replace votes = 0.17 in 9
replace seats = 0 in 9
replace treat = 0 in 9

replace partyname = "Rebirth Party" in 10
replace votes = 0.14 in 10
replace seats = 0 in 10
replace treat = 0 in 10

replace partyname = "Socialist Power Party" in 11
replace votes = 0.12 in 11
replace seats = 0 in 11
replace treat = 0 in 11

replace partyname = "Changing Turkey Party" in 12
replace votes = 0.12 in 12
replace seats = 0 in 12
replace treat = 0 in 12

replace partyname = "Democracy and Peace Party" in 13
replace votes = 0.08 in 13
replace seats = 0 in 13
replace treat = 0 in 13

** TURKEY 2011: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING
insobs 2, before(1)

replace countryname = "Turkey" in 1/2
replace year = 2011 in 1/2
replace threshold = 10 in 1/2
replace edate = "12jun2011" in 1/2

replace partyname = "Great Unity Party" in 1
replace votes = 0.75 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "People's Voice Party" in 2
replace votes = 0.77 in 2
replace seats = 0 in 2
replace treat = 0 in 2


** ITALY 1994: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING

drop if partyname == "PSDI" & countryname == "Italy" & year == 1994
drop if partyname == "Southern Action League" & countryname == "Italy" & year == 1994
drop if partyname == "Valdotanian Union" & countryname == "Italy" & year == 1994

insobs 5, before(1)

replace countryname = "Italy" in 1/5
replace year = 1994 in 1/5
replace threshold = 4 in 1/5
replace edate = "17mar1994" in 1/5

replace partyname = "Pannella List (LP)" in 1
replace votes = 3.51 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "Social Democracy for Freedoms (PSDI–FDS)" in 2
replace votes = 0.46 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "Program Italy (PI)" in 3
replace votes = 0.39 in 3
replace seats = 0 in 3
replace treat = 0 in 3

replace partyname = "Lombard Alpine League (LAL)" in 4
replace votes = 0.35 in 4
replace seats = 0 in 4
replace treat = 0 in 4

replace partyname = "Venetian Autonomy League (LAV)" in 5
replace votes = 0.27 in 5
replace seats = 0 in 5
replace treat = 0 in 5

** ITALY 1996: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING
insobs 27, before(1) 

drop if partyname == "MSFT" & countryname == "Italy" & year == 1996
drop if partyname == "RI" & countryname == "Italy" & year == 1996

replace countryname = "Italy" in 1/27
replace year = 1996 in 1/27
replace threshold = 4 in 1/27
replace edate = "21abr1996" in 1/27

replace partyname = "Pannella-Sgarbi List (LPS)" in 1
replace votes = 1.88 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "Tricolour Flame (FT) " in 2
replace votes = 0.91 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "Socialist Party (PS) " in 3
replace votes = 0.40 in 3
replace seats = 0 in 3
replace treat = 0 in 3

replace partyname = "Resurgence of the South" in 4
replace votes = 0.01 in 4
replace seats = 0 in 4
replace treat = 0 in 4

replace partyname = "North-East Union (UNE) " in 5
replace votes = 0.17 in 5
replace seats = 0 in 5
replace treat = 0 in 5

replace partyname = "Union for South Tyrol (UfS) " in 6
replace votes = 0.15 in 6
replace seats = 0 in 6
replace treat = 0 in 6

replace partyname = "Clean Hands (MP) " in 7
replace votes = 0.12 in 7
replace seats = 0 in 7
replace treat = 0 in 7

replace partyname = "We Sicilians – Sicilian National Front (NS–FNS)" in 8
replace votes = 0.11 in 8
replace seats = 0 in 8
replace treat = 0 in 8

replace partyname = "Sardinian Action Party (PSd'Az) " in 9
replace votes = 0.10 in 9
replace seats = 0 in 9
replace treat = 0 in 9

replace partyname = "Greens Greens" in 10
replace votes = 0.07 in 10
replace seats = 0 in 10
replace treat = 0 in 10

replace partyname = "Sardigna Natzione (SN) " in 11
replace votes = 0.06 in 11
replace seats = 0 in 11
replace treat = 0 in 11

replace partyname = "Independent Group Freedom " in 12
replace votes = 0.05 in 12
replace seats = 0 in 12
replace treat = 0 in 12

replace partyname = "Environmentalists" in 13
replace votes = 0.04 in 13
replace seats = 0 in 13
replace treat = 0 in 13

replace partyname = "Humanist Party (PU) " in 14
replace votes = 0.04 in 14
replace seats = 0 in 14
replace treat = 0 in 14

replace partyname = "Renovation" in 15
replace votes = 0.04 in 15
replace seats = 0 in 15
replace treat = 0 in 15

replace partyname = "Pact for the Agro" in 16
replace votes = 0.03 in 16
replace seats = 0 in 16
replace treat = 0 in 16

replace partyname = "Social Democracy " in 17
replace votes = 0.02 in 17
replace seats = 0 in 17
replace treat = 0 in 17

replace partyname = "Italian Renaissance Movement (MRI) " in 18
replace votes = 0.02 in 18
replace seats = 0 in 18
replace treat = 0 in 18 

replace partyname = "Tuscan Autonomist Movement (MAT) " in 19
replace votes = 0.02 in 19
replace seats = 0 in 19
replace treat = 0 in 19

replace partyname = "Natural Law Party (PLN) " in 20
replace votes = 0.02 in 20
replace seats = 0 in 20
replace treat = 0 in 20

replace partyname = "New Democracy " in 21
replace votes = 0.02 in 21
replace seats = 0 in 21
replace treat = 0 in 21

replace partyname = "Liberal Federalists (FL)" in 22
replace votes = 0.02 in 22
replace seats = 0 in 22
replace treat = 0 in 22

replace partyname = "For Marche " in 23
replace votes = 0.01 in 23
replace seats = 0 in 23
replace treat = 0 in 23

replace partyname = "New Energies" in 24
replace votes = 0.01 in 24
replace seats = 0 in 24
replace treat = 0 in 24

replace partyname = "Development and Legality " in 25
replace votes = 0.01 in 25
replace seats = 0 in 25
replace treat = 0 in 25

replace partyname = "Free North Autonomy" in 26
replace votes = 0.01 in 26
replace seats = 0 in 26
replace treat = 0 in 26

replace partyname = "Federalist Party (PF)" in 27
replace votes = 0.01 in 27
replace seats = 0 in 27
replace treat = 0 in 27


** ITALY 2001: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING

insobs 22, before(1) 

replace countryname = "Italy" in 1/22
replace year = 2001 in 1/22
replace threshold = 4 in 1/22
replace edate = "13may2001" in 1/22

replace partyname = "European Democracy (DE)" in 1
replace votes = 2.39 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "Bonino List (LB)" in 2
replace votes = 2.24 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "Party of Italian Communists (PdCI) " in 3
replace votes = 1.67 in 3
replace seats = 0 in 3
replace treat = 0 in 3

replace partyname = "Tricolour Flame (FT) " in 4
replace votes = 0.39 in 4
replace seats = 0 in 4
replace treat = 0 in 4

replace partyname = "Venetian Front League (LFV) " in 5
replace votes = 0.20 in 5
replace seats = 0 in 5
replace treat = 0 in 5

replace partyname = "Pensioners' Party (PP)" in 6
replace votes = 0.18 in 6
replace seats = 0 in 6
replace treat = 0 in 6

replace partyname = "Sardinian Action Party–Sardigna Natzione (PSd'Az–SN) " in 7
replace votes = 0.09 in 7
replace seats = 0 in 7
replace treat = 0 in 7

replace partyname = "New Country" in 8
replace votes = 0.09 in 8
replace seats = 0 in 8
replace treat = 0 in 8

replace partyname = "Abolizione Scorporo" in 9
replace votes = 0.07 in 9
replace seats = 0 in 9
replace treat = 0 in 9

replace partyname = "Southern Action League (LAM) " in 10
replace votes = 0.06 in 10
replace seats = 0 in 10
replace treat = 0 in 10

replace partyname = "National Social Front (FSN) " in 11
replace votes = 0.06 in 11
replace seats = 0 in 11
replace treat = 0 in 11

replace partyname = "Greens Greens (VV) " in 12
replace votes = 0.05 in 12
replace seats = 0 in 12
replace treat = 0 in 12

replace partyname = "New Force (FN) " in 13
replace votes = 0.04 in 13
replace seats = 0 in 13
replace treat = 0 in 13

replace partyname = "Amadu List " in 14
replace votes = 0.03 in 14
replace seats = 0 in 14
replace treat = 0 in 14

replace partyname = "European Republicans Movement (MRE) " in 15
replace votes = 0.02 in 15
replace seats = 0 in 15
replace treat = 0 in 15

replace partyname = "We Sicilians (NS) " in 16
replace votes = 0.02 in 16
replace seats = 0 in 16
replace treat = 0 in 16

replace partyname = "Movement of Freedoms " in 17
replace votes = 0.02 in 17
replace seats = 0 in 17
replace treat = 0 in 17

replace partyname = "Free and Strong" in 18
replace votes = 0.02 in 18
replace seats = 0 in 18
replace treat = 0 in 18 

replace partyname = "Autonomist Socialists " in 19
replace votes = 0.02 in 19
replace seats = 0 in 19
replace treat = 0 in 19

replace partyname = "It's enough!" in 20
replace votes = 0.02 in 20
replace seats = 0 in 20
replace treat = 0 in 20

replace partyname = "Communism" in 21
replace votes = 0.01 in 21
replace seats = 0 in 21
replace treat = 0 in 21

replace partyname = "CThird Pole for Autonomy" in 22
replace votes = 0.01 in 22
replace seats = 0 in 22
replace treat = 0 in 22

** ITALY 2006: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING

drop if partyname == "MSFT" & countryname == "Italy" & year == 2006
drop if partyname == "Valdotanian Union" & countryname == "Italy" & year == 2006

insobs 24, before(1) 


replace countryname = "Italy" in 1/24
replace year = 2006 in 1/24
replace threshold = 4 in 1/24
replace edate = "09abr2006" in 1/24

replace partyname = "Pensioners' Party (PP)" in 1
replace votes = 0.87 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "The Socialists (IS)" in 2
replace votes = 0.19 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "Consumers' List (LC)" in 3
replace votes = 0.19 in 3
replace seats = 0 in 3
replace treat = 0 in 3

replace partyname = "League for Autonomy – Lombard Alliance (LAL)" in 4
replace votes = 0.12 in 4
replace seats = 0 in 4
replace treat = 0 in 4

replace partyname = "Veneto Front League (LFV)" in 5
replace votes = 0.06 in 5
replace seats = 0 in 5
replace treat = 0 in 5

replace partyname = "Social Alternative (AS)" in 6
replace votes = 0.67 in 6
replace seats = 0 in 6
replace treat = 0 in 6

replace partyname = "Tricolour Flame (FT)" in 7
replace votes = 0.60 in 7
replace seats = 0 in 7
replace treat = 0 in 7

replace partyname = "No Euro (NE)" in 8
replace votes = 0.15 in 8
replace seats = 0 in 8
replace treat = 0 in 8

replace partyname = "United Pensioners (PU)" in 9
replace votes = 0.07 in 9
replace seats = 0 in 9
replace treat = 0 in 9

replace partyname = "Democratic Ecologists (ED)" in 10
replace votes = 0.04 in 10
replace seats = 0 in 10
replace treat = 0 in 10

replace partyname = "Italian Liberal Party (PLI)" in 11
replace votes = 0.03 in 11
replace seats = 0 in 11
replace treat = 0 in 11

replace partyname = "S.O.S. Italy" in 12
replace votes = 0.02 in 12
replace seats = 0 in 12
replace treat = 0 in 12

replace partyname = "North-East Project (PNE)" in 13
replace votes = 0.24 in 13
replace seats = 0 in 13
replace treat = 0 in 13

replace partyname = "Die Freiheitlichen (dF)" in 14
replace votes = 0.05 in 14
replace seats = 0 in 14
replace treat = 0 in 14

replace partyname = "Third Pole (TP)" in 15
replace votes = 0.04 in 15
replace seats = 0 in 15
replace treat = 0 in 15

replace partyname = "Independence Republic of Sardinia (IRS)" in 16
replace votes = 0.03 in 16
replace seats = 0 in 16
replace treat = 0 in 16

replace partyname = "Sardigna Natzione Indipendentzia (SNI)" in 17
replace votes = 0.03 in 17
replace seats = 0 in 17
replace treat = 0 in 17

replace partyname = "Solidarity" in 18
replace votes = 0.02 in 18
replace seats = 0 in 18
replace treat = 0 in 18 

replace partyname = "For the South" in 19
replace votes = 0.01 in 19
replace seats = 0 in 19
replace treat = 0 in 19

replace partyname = "Sicilian Democratic Movement – We Sicilians (MDS–NS)" in 20
replace votes = 0.01 in 20
replace seats = 0 in 20
replace treat = 0 in 20

replace partyname = "Triveneto Movement (MT)" in 21
replace votes = 0.01 in 21
replace seats = 0 in 21
replace treat = 0 in 21

replace partyname = "Christian Dimension (DC)" in 22
replace votes = 0.01 in 22
replace seats = 0 in 22
replace treat = 0 in 22

replace partyname = "National Right (DN)" in 23
replace votes = 0.0 in 23
replace seats = 0 in 23
replace treat = 0 in 23

replace partyname = "Southern League Ausonia (LSA)" in 24
replace votes = 0.0 in 24
replace seats = 0 in 24
replace treat = 0 in 24

** ITALY 2008: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING
* Drop a wrong party
drop if partyname == "Italian Associations in South America" & countryname == "Italy" & year == 2008
drop if partyname == "SDI/SI/PSI" & countryname == "Italy" & year == 2008
drop if partyname == "Valdotanian Union" & countryname == "Italy" & year == 2008

insobs 23, before(1) 

replace countryname = "Italy" in 1/23
replace year = 2008 in 1/23
replace threshold = 4 in 1/23
replace edate = "13apr2008" in 1/23

replace partyname = "The Left – The Rainbow (SA)" in 1
replace votes = 3.08 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "The Right – Tricolour Flame (LD–FT)" in 2
replace votes = 2.43 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "Socialist Party (PS)" in 3
replace votes = 0.98 in 3
replace seats = 0 in 3
replace treat = 0 in 3

replace partyname = "Workers' Communist Party (PCL)" in 4
replace votes = 0.57 in 4
replace seats = 0 in 4
replace treat = 0 in 4

replace partyname = "Critical Left (SC)" in 5
replace votes = 0.46 in 5
replace seats = 0 in 5
replace treat = 0 in 5

replace partyname = "Association for Defense of Life" in 6
replace votes = 0.37 in 6
replace seats = 0 in 6
replace treat = 0 in 6

replace partyname = "For the Common Good (PBC)" in 7
replace votes = 0.33 in 7
replace seats = 0 in 7
replace treat = 0 in 7

replace partyname = "New Force (FN)" in 8
replace votes = 0.30 in 8
replace seats = 0 in 8
replace treat = 0 in 8

replace partyname = "Italian Liberal Party (PLI)" in 9
replace votes = 0.29 in 9
replace seats = 0 in 9
replace treat = 0 in 9

replace partyname = "Democratic Union for Consumers (UDpC)" in 10
replace votes = 0.25 in 10
replace seats = 0 in 10
replace treat = 0 in 10

replace partyname = "List of Talking Crickets (No Euro–Lega Padana–others)" in 11
replace votes = 0.18 in 11
replace seats = 0 in 11
replace treat = 0 in 11

replace partyname = "Venetian Republic League (LVR)" in 12
replace votes = 0.09 in 12
replace seats = 0 in 12
replace treat = 0 in 12

replace partyname = "Die Freiheitlichen (DF)" in 13
replace votes = 0.08 in 13
replace seats = 0 in 13
replace treat = 0 in 13

replace partyname = "European Movement Disabled Persons (MEDA)" in 14
replace votes = 0.05 in 14
replace seats = 0 in 14
replace treat = 0 in 14

replace partyname = "Sardinian Action Party (PSd'Az)" in 15
replace votes = 0.04 in 15
replace seats = 0 in 15
replace treat = 0 in 15

replace partyname = "League for Autonomy – Lombard Alliance (LAL)" in 16
replace votes = 0.04 in 16
replace seats = 0 in 16
replace treat = 0 in 16

replace partyname = "Union for South Tyrol (UfS)" in 17
replace votes = 0.04 in 17
replace seats = 0 in 17
replace treat = 0 in 17

replace partyname = "Sardigna Natzione Indipendentzia (SNI)" in 18
replace votes = 0.02 in 18
replace seats = 0 in 18
replace treat = 0 in 18 

replace partyname = "Southern League Ausonia (LSA)" in 19
replace votes = 0.01 in 19
replace seats = 0 in 19
replace treat = 0 in 19

replace partyname = "Venetian Agreement (IV)" in 20
replace votes = 0.01 in 20
replace seats = 0 in 20
replace treat = 0 in 20

replace partyname = "Communist Alternative Party (PdAC)" in 21
replace votes = 0.01 in 21
replace seats = 0 in 21
replace treat = 0 in 21

replace partyname = "The Lotus" in 22
replace votes = 0.0 in 22
replace seats = 0 in 22
replace treat = 0 in 22

replace partyname = " Thought and Action Party (PPA)" in 23
replace votes = 0.0 in 23
replace seats = 0 in 23
replace treat = 0 in 23


** GERMANY 1961: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING
insobs 2, before(1) 

replace countryname = "Germany" in 1/2
replace year = 1961 in 1/2
replace threshold = 5 in 1/2
replace edate = "17sep1961" in 1/2


replace partyname = "German Community (DG)" in 1
replace votes = 0.1 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "South Schleswig Voters' Association (SSW)" in 2
replace votes = 0.1 in 2
replace seats = 0 in 2
replace treat = 0 in 2

** GERMANY 1965: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING
insobs 5, before(1) 

replace countryname = "Germany" in 1/5
replace year = 1965 in 1/5
replace threshold = 5 in 1/5
replace edate = "19sep1965" in 1/5

drop if countryname == "Germany" &  year == 1965 & partyname == "Gesamtdeutsche Volkspartei"

replace partyname = "Action Community of Independent Germans (AUD)" in 1
replace votes = 0.2 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "Christian People's Party (CVP)" in 2
replace votes = 0.1 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "Free Social Union (FSU)" in 3
replace votes = 0 in 3
replace seats = 0 in 3
replace treat = 0 in 3

replace partyname = "Independent Workers' Party (UAP)" in 4
replace votes = 0 in 4
replace seats = 0 in 4
replace treat = 0 in 4

replace partyname = "European Federalist Party (EFP)" in 5
replace votes = 0 in 5
replace seats = 0 in 5
replace treat = 0 in 5

** GERMANY 1969: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING
insobs 7, before(1) 

replace countryname = "Germany" in 1/7
replace year = 1969 in 1/7
replace threshold = 5 in 1/7
replace edate = "28sep1969" in 1/7

drop if countryname == "Germany" &  year == 1969 & partyname == "Gesamtdeutsche Volkspartei"

replace partyname = "Campaign for Democratic Progress (ADF)" in 1
replace votes = 0.6 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "Bavaria Party (BP)" in 2
replace votes = 0.2 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "European Federalist Party (EFP)" in 3
replace votes = 0.2 in 3
replace seats = 0 in 3
replace treat = 0 in 3

replace partyname = "Centre Party (ZENTRUM)" in 4
replace votes = 0 in 4
replace seats = 0 in 4
replace treat = 0 in 4

replace partyname = "All-German Party (GDP)" in 5
replace votes = 0.1 in 5
replace seats = 0 in 5
replace treat = 0 in 5

replace partyname = "Free Social Union (FSU)" in 6
replace votes = 0 in 6
replace seats = 0 in 6
replace treat = 0 in 6

replace partyname = "Independent Workers' Party (UAP)" in 7
replace votes = 0 in 7
replace seats = 0 in 7
replace treat = 0 in 7

** GERMANY 1972: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING
insobs 4, before(1) 

replace countryname = "Germany" in 1/4
replace year = 1972 in 1/4
replace threshold = 5 in 1/4
replace edate = "19nov1972" in 1/4

drop if countryname == "Germany" &  year == 1972 & partyname == "Deutsche Reichspartei"

replace partyname = "National Democratic Party (NPD)" in 1
replace votes = 0.6 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "German Communist Party (DKP)" in 2
replace votes = 0.4 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "European Federalist Party (EFP)" in 3
replace votes = 0 in 3
replace seats = 0 in 3
replace treat = 0 in 3

replace partyname = "Free Social Union (FSU)" in 4
replace votes = 0 in 4
replace seats = 0 in 4
replace treat = 0 in 4

** GERMANY 1976: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING
insobs 12, before(1) 

replace countryname = "Germany" in 1/12
replace year = 1976 in 1/12
replace threshold = 5 in 1/12
replace edate = "03oct1976" in 1/12

drop if countryname == "Germany" &  year == 1976 & partyname == "Deutsche Reichspartei"

replace partyname = "National Democratic Party (NPD)" in 1
replace votes = 0.3 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "German Communist Party (DKP)" in 2
replace votes = 0.3 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "Communist Party of Germany (KPD-AO)" in 3
replace votes = 0.1 in 3
replace seats = 0 in 3
replace treat = 0 in 3

replace partyname = "Action Community of Independent Germans (AUD)" in 4
replace votes = 0.1 in 4
replace seats = 0 in 4
replace treat = 0 in 4

replace partyname = "Communist League of West Germany (KBW)" in 5
replace votes = 0.1 in 5
replace seats = 0 in 5
replace treat = 0 in 5

replace partyname = "European Workers' Party (EAP)" in 6
replace votes = 0 in 6
replace seats = 0 in 6
replace treat = 0 in 6

replace partyname = "Christian Bavarian People's Party (CBV)" in 7
replace votes = 0 in 7
replace seats = 0 in 7
replace treat = 0 in 7

replace partyname = "International Marxist Group (GIM)" in 8
replace votes = 0 in 8
replace seats = 0 in 8
replace treat = 0 in 8

replace partyname = "Action Community Fourth Party (AVP)" in 9
replace votes = 0 in 9
replace seats = 0 in 9
replace treat = 0 in 9

replace partyname = "5%-Block" in 10
replace votes = 0 in 10
replace seats = 0 in 10
replace treat = 0 in 10

replace partyname = "Independent Workers' Party (UAP)" in 11
replace votes = 0 in 11
replace seats = 0 in 11
replace treat = 0 in 11

replace partyname = "United Left (VL)" in 12
replace votes = 0 in 12
replace seats = 0 in 12
replace treat = 0 in 12

** GERMANY 1980: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING
insobs 7, before(1) 

replace countryname = "Germany" in 1/7
replace year = 1980 in 1/7
replace threshold = 5 in 1/7
replace edate = "05oct1980" in 1/7

drop if countryname == "Germany" &  year == 1980 & partyname == "Deutsche Reichspartei"

replace partyname = "German Communist Party (DKP)" in 1
replace votes = 0.2 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "National Democratic Party (NPD)" in 2
replace votes = 0.2 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "Citizens' Party" in 3
replace votes = 0 in 3
replace seats = 0 in 3
replace treat = 0 in 3

replace partyname = "People's Front Against Reaction, Fascism and War (V)" in 4
replace votes = 0 in 4
replace seats = 0 in 4
replace treat = 0 in 4

replace partyname = "Communist League of West Germany (KBW)" in 5
replace votes = 0 in 5
replace seats = 0 in 5
replace treat = 0 in 5

replace partyname = "European Workers' Party (EAP)" in 6
replace votes = 0 in 6
replace seats = 0 in 6
replace treat = 0 in 6

replace partyname = "Christian Bavarian People's Party (CBV)" in 7
replace votes = 0 in 7
replace seats = 0 in 7
replace treat = 0 in 7


** GERMANY 1983: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING
insobs 8, before(1) 

replace countryname = "Germany" in 1/8
replace year = 1983 in 1/8
replace threshold = 5 in 1/8
replace edate = "06mar1983" in 1/8

drop if countryname == "Germany" &  year == 1983 & partyname == "Deutsche Reichspartei"

replace partyname = "National Democratic Party (NPD)" in 1
replace votes = 0.2 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "German Communist Party (DKP)" in 2
replace votes = 0.2 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "European Workers' Party (EAP)" in 3
replace votes = 0 in 3
replace seats = 0 in 3
replace treat = 0 in 3

replace partyname = "Ecological Democratic Party (ÖDP)" in 4
replace votes = 0 in 4
replace seats = 0 in 4
replace treat = 0 in 4

replace partyname = "Christian Bavarian People's Party (CBV)" in 5
replace votes = 0 in 5
replace seats = 0 in 5
replace treat = 0 in 5

replace partyname = "Communist Party of Germany/Marxists–Leninists (KPD/ML)" in 6
replace votes = 0 in 6
replace seats = 0 in 6
replace treat = 0 in 6

replace partyname = "Independent Social Democrats (USD)" in 7
replace votes = 0 in 7
replace seats = 0 in 7
replace treat = 0 in 7

replace partyname = " 	League of West German Communists (BWK)" in 8
replace votes = 0 in 8
replace seats = 0 in 8
replace treat = 0 in 8

** GERMANY 1987: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING
insobs 11, before(1) 

replace countryname = "Germany" in 1/11
replace year = 1987 in 1/11
replace threshold = 5 in 1/11
replace edate = "25jan1987" in 1/11

drop if countryname == "Germany" &  year == 1987 & partyname == "Deutsche Reichspartei"

replace partyname = "National Democratic Party (NPD)" in 1
replace votes = 0.6 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "Ecological Democratic Party (ÖDP)" in 2
replace votes = 0.3 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "The Women (FRAUEN)" in 3
replace votes = 0.2 in 3
replace seats = 0 in 3
replace treat = 0 in 3

replace partyname = "Bavaria Party (BP)" in 4
replace votes = 0.1 in 4
replace seats = 0 in 4
replace treat = 0 in 4

replace partyname = "Responsible Citizens" in 5
replace votes = 0.1 in 5
replace seats = 0 in 5
replace treat = 0 in 5

replace partyname = "Patriots for Germany (Patrioten)" in 6
replace votes = 0.1 in 6
replace seats = 0 in 6
replace treat = 0 in 6

replace partyname = "Centre Party (ZENTRUM)" in 7
replace votes = 0.1 in 7
replace seats = 0 in 7
replace treat = 0 in 7

replace partyname = "Marxist–Leninist Party of Germany (MLPD)" in 8
replace votes = 0 in 8
replace seats = 0 in 8
replace treat = 0 in 8

replace partyname = "Christian Bavarian People's Party (CBV)" in 9
replace votes = 0 in 9
replace seats = 0 in 9
replace treat = 0 in 9

replace partyname = "All Social Insurants and Pensioners (ASD)" in 10
replace votes = 0 in 10
replace seats = 0 in 10
replace treat = 0 in 10

replace partyname = "Free German Workers' Party (FAP)" in 11
replace votes = 0 in 11
replace seats = 0 in 11
replace treat = 0 in 11

** GERMANY 1990: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING AND correct Alliance 90/Greens – Citizens' Movement (East)
insobs 17, before(1) 

replace countryname = "Germany" in 1/17
replace year = 1990 in 1/17
replace threshold = 5 in 1/17
replace edate = "02sdec1990" in 1/17

drop if countryname == "Germany" &  year == 1990 & partyname == "Deutsche Reichspartei"

replace partyname = "Alliance 90/Greens – Citizens' Movement (B90/Gr.) (East)" in 1
replace votes = 1.2 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "The Grays – Gray Panthers (GRAUE)" in 2
replace votes = 0.8 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "Ecological Democratic Party (ÖDP)" in 3
replace votes = 0.4 in 3
replace seats = 0 in 3
replace treat = 0 in 3

replace partyname = "National Democratic Party (NPD)" in 4
replace votes = 0.3 in 4
replace seats = 0 in 4
replace treat = 0 in 4

replace partyname = "German Social Union (DSU)" in 5
replace votes = 0.2 in 5
replace seats = 0 in 5
replace treat = 0 in 5

replace partyname = "Christian League (Liga)" in 6
replace votes = 0.1 in 6
replace seats = 0 in 6
replace treat = 0 in 6

replace partyname = "Christian Centre (CM)" in 7
replace votes = 0.1 in 7
replace seats = 0 in 7
replace treat = 0 in 7

replace partyname = "Bavaria Party (BP)" in 8
replace votes = 0.1 in 8
replace seats = 0 in 8
replace treat = 0 in 8

replace partyname = "The Women (FRAUEN)" in 9
replace votes = 0 in 9
replace seats = 0 in 9
replace treat = 0 in 9

replace partyname = "Patriots for Germany (Patrioten)" in 10
replace votes = 0 in 10
replace seats = 0 in 10
replace treat = 0 in 10

replace partyname = "Eco-Union (ÖKO-UNION)" in 11
replace votes = 0 in 11
replace seats = 0 in 11
replace treat = 0 in 11

replace partyname = "Union of Working Groups for Employee Politics and Democracy (VAA)" in 12
replace votes = 0 in 12
replace seats = 0 in 12
replace treat = 0 in 12

replace partyname = "Communist Party of Germany (KPD)" in 13
replace votes = 0 in 13
replace seats = 0 in 13
replace treat = 0 in 13

replace partyname = "Spartacist Workers' Party of Germany (SpAD)" in 14
replace votes = 0 in 14
replace seats = 0 in 14
replace treat = 0 in 14

replace partyname = "Federation of German Democrats (DDD)" in 15
replace votes = 0 in 15
replace seats = 0 in 15
replace treat = 0 in 15

replace partyname = "Federation of Socialist Workers (BSA)" in 16
replace votes = 0 in 16
replace seats = 0 in 16
replace treat = 0 in 16

replace partyname = "Responsible Citizens" in 17
replace votes = 0 in 17
replace seats = 0 in 17
replace treat = 0 in 17

replace seats = 8 if strpos(partyname, "Alliance 90/Greens") & countryname == "Germany" &  year == 1990
replace treat = 1 if strpos(partyname, "Alliance 90/Greens") & countryname == "Germany" &  year == 1990

replace seats = 0 if strpos(partyname, "Die Gr") & countryname == "Germany" &  year == 1990
replace treat = 0 if strpos(partyname, "Die Gr") & countryname == "Germany" &  year == 1990

ta partyname if countryname == "Germany" &  year == 1990


** GERMANY 1994: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING
insobs 15, before(1) 

replace countryname = "Germany" in 1/15
replace year = 1994 in 1/15
replace threshold = 5 in 1/15
replace edate = "16oct1994" in 1/15

drop if countryname == "Germany" &  year == 1994 & partyname == "Deutsche Reichspartei"

replace partyname = "The Grays – Gray Panthers (GRAUE)" in 1
replace votes = 0.5 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "Ecological Democratic Party (ÖDP)" in 2
replace votes = 0.4 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "Natural Law Party (Naturgesetz)" in 3
replace votes = 0.2 in 3
replace seats = 0 in 3
replace treat = 0 in 3

replace partyname = "Human Environment Animal Protection" in 4
replace votes = 0.2 in 4
replace seats = 0 in 4
replace treat = 0 in 4

replace partyname = "Party of Bible-abiding Christians (PBC)" in 5
replace votes = 0.1 in 5
replace seats = 0 in 5
replace treat = 0 in 5

replace partyname = "Statt Party (STATT)" in 6
replace votes = 0.1 in 6
replace seats = 0 in 6
replace treat = 0 in 6

replace partyname = "Bavaria Party (BP)" in 7
replace votes = 0.1 in 7
replace seats = 0 in 7
replace treat = 0 in 7

replace partyname = "Car-drivers' and Citizens' Interests Party (APD)" in 8
replace votes = 0 in 8
replace seats = 0 in 8
replace treat = 0 in 8

replace partyname = "Christian Centre (CM)" in 9
replace votes = 0 in 9
replace seats = 0 in 9
replace treat = 0 in 9

replace partyname = "Party of the Willing to Work and Socially Vulnerable (PASS)" in 10
replace votes = 0 in 10
replace seats = 0 in 10
replace treat = 0 in 10

replace partyname = "Marxist-Leninist Party (MLPD)" in 11
replace votes = 0 in 11
replace seats = 0 in 11
replace treat = 0 in 11

replace partyname = "Bürgerrechtsbewegung Solidarität (BüSo)" in 12
replace votes = 0 in 12
replace seats = 0 in 12
replace treat = 0 in 12

replace partyname = "Christian League (Liga)" in 13
replace votes = 0 in 13
replace seats = 0 in 13
replace treat = 0 in 13

replace partyname = "Centre Party (ZENTRUM)" in 14
replace votes = 0 in 14
replace seats = 0 in 14
replace treat = 0 in 14

replace partyname = "Federation of Socialist Workers (BSA)" in 15
replace votes = 0 in 15
replace seats = 0 in 15
replace treat = 0 in 15


** GERMANY 1998: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING
insobs 26, before(1) 

replace countryname = "Germany" in 1/26
replace year = 1998 in 1/26
replace threshold = 5 in 1/26
replace edate = "27sep1998" in 1/26

drop if countryname == "Germany" &  year == 1998 & partyname == "Deutsche Reichspartei"

replace partyname = "German People's Union (DVU)" in 1
replace votes = 1.2 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "Initiative Pro D-Mark (Pro DM)" in 2
replace votes = 0.9 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "The Grays – Gray Panthers (GRAUE)" in 3
replace votes = 0.3 in 3
replace seats = 0 in 3
replace treat = 0 in 3

replace partyname = "Human Environment Animal Protection" in 4
replace votes = 0.3 in 4
replace seats = 0 in 4
replace treat = 0 in 4

replace partyname = "National Democratic Party (NPD))" in 5
replace votes = 0.3 in 5
replace seats = 0 in 5
replace treat = 0 in 5

replace partyname = "Federation of Free Citizens – The Offensive (BFB)" in 6
replace votes = 0.2 in 6
replace seats = 0 in 6
replace treat = 0 in 6

replace partyname = "Ecological Democratic Party (ödp)" in 7
replace votes = 0.2 in 7
replace seats = 0 in 7
replace treat = 0 in 7

replace partyname = "Party of Bible-abiding Christians (PBC)" in 8
replace votes = 0.1 in 8
replace seats = 0 in 8
replace treat = 0 in 8

replace partyname = "Anarchist Pogo Party (APPD)" in 9
replace votes = 0.1 in 9
replace seats = 0 in 9
replace treat = 0 in 9

replace partyname = "Natural Law Party (Naturgesetz)" in 10
replace votes = 0.1 in 10
replace seats = 0 in 10
replace treat = 0 in 10

replace partyname = "Feminist Party (DIE FRAUEN)" in 11
replace votes = 0.1 in 11
replace seats = 0 in 11
replace treat = 0 in 11

replace partyname = "Chance 2000" in 12
replace votes = 0.1 in 12
replace seats = 0 in 12
replace treat = 0 in 12

replace partyname = "Bavaria Party (BP)" in 13
replace votes = 0.1 in 13
replace seats = 0 in 13
replace treat = 0 in 13

replace partyname = "Family Party (FAMILIE)" in 14
replace votes = 0.1 in 14
replace seats = 0 in 14
replace treat = 0 in 14

replace partyname = "Christian Centre (CM)" in 15
replace votes = 0 in 15
replace seats = 0 in 15
replace treat = 0 in 15

replace partyname = "Bürgerrechtsbewegung Solidarität (BüSo)" in 16
replace votes = 0 in 16
replace seats = 0 in 16
replace treat = 0 in 16

replace partyname = "Party of the Non-voters (Nichtwähler)" in 17
replace votes = 0 in 17
replace seats = 0 in 17
replace treat = 0 in 17

replace partyname = "Car-drivers' and Citizens' Interests Party (APD)" in 18
replace votes = 0 in 18
replace seats = 0 in 18
replace treat = 0 in 18

replace partyname = "Party for Social Equality (PSG)" in 19
replace votes = 0 in 19
replace seats = 0 in 19
replace treat = 0 in 19

replace partyname = "Alliance for Germany (Deutschland)" in 20
replace votes = 0 in 20
replace seats = 0 in 20
replace treat = 0 in 20

replace partyname = "Party of the Willing to Work and Socially Vulnerable (PASS)" in 21
replace votes = 0 in 21
replace seats = 0 in 21
replace treat = 0 in 21

replace partyname = "Marxist-Leninist Party (MLPD)" in 22
replace votes = 0 in 22
replace seats = 0 in 22
replace treat = 0 in 22

replace partyname = "New Forum (FORUM)" in 23
replace votes = 0 in 23
replace seats = 0 in 23
replace treat = 0 in 23

replace partyname = "Alternative Citizens' Movement 2000 (AB 2000)" in 24
replace votes = 0 in 24
replace seats = 0 in 24
replace treat = 0 in 24

replace partyname = "Democratic Party (DPD)" in 25
replace votes = 0 in 25
replace seats = 0 in 25
replace treat = 0 in 25

replace partyname = "Humanist Party (HP)" in 26
replace votes = 0 in 26
replace seats = 0 in 26
replace treat = 0 in 26


** GERMANY 2002: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING
insobs 16, before(1) 

replace countryname = "Germany" in 1/16
replace year = 2002 in 1/16
replace threshold = 5 in 1/16
replace edate = "22sep2002" in 1/16

replace partyname = "Party for a Rule of Law Offensive (Schill)" in 1
replace votes = 0.8 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "Human Environment Animal Protection" in 2
replace votes = 0.3 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "The Grays – Gray Panthers (GRAUE)" in 3
replace votes = 0.2 in 3
replace seats = 0 in 3
replace treat = 0 in 3

replace partyname = "Party of Bible-abiding Christians (PBC)" in 4
replace votes = 0.2 in 4
replace seats = 0 in 4
replace treat = 0 in 4

replace partyname = "Ecological Democratic Party (ödp)" in 5
replace votes = 0.1 in 5
replace seats = 0 in 5
replace treat = 0 in 5

replace partyname = "Feminist Party (DIE FRAUEN)" in 6
replace votes = 0.1 in 6
replace seats = 0 in 6
replace treat = 0 in 6

replace partyname = "Family Party (FAMILIE)" in 7
replace votes = 0.1 in 7
replace seats = 0 in 7
replace treat = 0 in 7

replace partyname = "Bürgerrechtsbewegung Solidarität (BüSo)" in 8
replace votes = 0 in 8
replace seats = 0 in 8
replace treat = 0 in 8

replace partyname = "Christian Centre (CM)" in 9
replace votes = 0 in 9
replace seats = 0 in 9
replace treat = 0 in 9

replace partyname = "Bavaria Party (BP)" in 10
replace votes = 0 in 10
replace seats = 0 in 10
replace treat = 0 in 10

replace partyname = "Party for Pension Justice and Family (PRG)" in 11
replace votes = 0.9 in 11
replace seats = 0 in 11
replace treat = 0 in 11

replace partyname = "Departure for Civil Rights, Freedom and Health" in 12
replace votes = 0 in 12
replace seats = 0 in 12
replace treat = 0 in 12

replace partyname = "Centre Party (ZENTRUM)" in 13
replace votes = 0 in 13
replace seats = 0 in 13
replace treat = 0 in 13

replace partyname = "Humanist Party (HP)" in 14
replace votes = 0 in 14
replace seats = 0 in 14
replace treat = 0 in 14

replace partyname = "The Violets (DIE VIOLETTEN)" in 15
replace votes = 0 in 15
replace seats = 0 in 15
replace treat = 0 in 15

replace partyname = "Communist Party of Germany (KPD)" in 16
replace votes = 0 in 16
replace seats = 0 in 16
replace treat = 0 in 16

** GERMANY 2005: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING
insobs 17, before(1) 

replace countryname = "Germany" in 1/17
replace year = 2005 in 1/17
replace threshold = 5 in 1/17
replace edate = "18sep2005" in 1/17

replace partyname = "The Grays – Gray Panthers (GRAUE)" in 1
replace votes = 0.4 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "Family Party (FAMILIE)" in 2
replace votes = 0.4 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "Human Environment Animal Protection" in 3
replace votes = 0.2 in 3
replace seats = 0 in 3
replace treat = 0 in 3

replace partyname = "Party of Bible-abiding Christians (PBC)" in 4
replace votes = 0.2 in 4
replace seats = 0 in 4
replace treat = 0 in 4

replace partyname = "Marxist-Leninist Party (MLPD)" in 5
replace votes = 0.1 in 5
replace seats = 0 in 5
replace treat = 0 in 5

replace partyname = "Bürgerrechtsbewegung Solidarität (BüSo)" in 6
replace votes = 0.1 in 6
replace seats = 0 in 6
replace treat = 0 in 6

replace partyname = "Bavaria Party (BP)" in 7
replace votes = 0.1 in 7
replace seats = 0 in 7
replace treat = 0 in 7

replace partyname = "Feminist Party (DIE FRAUEN)" in 8
replace votes = 0.1 in 8
replace seats = 0 in 8
replace treat = 0 in 8

replace partyname = "Alliance for Health, Peace and Social Justice" in 9
replace votes = 0 in 9
replace seats = 0 in 9
replace treat = 0 in 9

replace partyname = "Party for Social Equality (PSG)" in 10
replace votes = 0 in 10
replace seats = 0 in 10
replace treat = 0 in 10

replace partyname = "50Plus" in 11
replace votes = 0 in 11
replace seats = 0 in 11
replace treat = 0 in 11

replace partyname = "Die PARTEI" in 12
replace votes = 0 in 12
replace seats = 0 in 12
replace treat = 0 in 12

replace partyname = "Pro DM" in 13
replace votes = 0 in 13
replace seats = 0 in 13
replace treat = 0 in 13

replace partyname = "Alliance for Germany (Deutschland)" in 14
replace votes = 0 in 14
replace seats = 0 in 14
replace treat = 0 in 14

replace partyname = "Anarchist Pogo Party (APPD)" in 15
replace votes = 0 in 15
replace seats = 0 in 15
replace treat = 0 in 15

replace partyname = "Centre Party (ZENTRUM)" in 16
replace votes = 0 in 16
replace seats = 0 in 16
replace treat = 0 in 16

replace partyname = "Party for a Rule of Law Offensive (Offensive D)" in 17
replace votes = 0 in 17
replace seats = 0 in 17
replace treat = 0 in 17


** GERMANY 2009: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING
insobs 18, before(1) 

replace countryname = "Germany" in 1/18
replace year = 2009 in 1/18
replace threshold = 5 in 1/18
replace edate = "27sep2009" in 1/18

replace partyname = "Human Environment Animal Protection" in 1
replace votes = 0.5 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "Ecological Democratic Party (ödp)" in 2
replace votes = 0.3 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "Family Party (FAMILIE)" in 3
replace votes = 0.3 in 3
replace seats = 0 in 3
replace treat = 0 in 3

replace partyname = "Alliance 21/RRP" in 4
replace votes = 0.2 in 4
replace seats = 0 in 4
replace treat = 0 in 4

replace partyname = "Pensioners' Party (RENTNER)" in 5
replace votes = 0.1 in 5
replace seats = 0 in 5
replace treat = 0 in 5

replace partyname = "Bavaria Party (BP)" in 6
replace votes = 0.1 in 6
replace seats = 0 in 6
replace treat = 0 in 6

replace partyname = "German People's Union (DVU)" in 7
replace votes = 0.1 in 7
replace seats = 0 in 7
replace treat = 0 in 7

replace partyname = "Party of Bible-abiding Christians (PBC)" in 8
replace votes = 0.1 in 8
replace seats = 0 in 8
replace treat = 0 in 8

replace partyname = "Civil Rights Movement Solidarity (BüSo)" in 9
replace votes = 0.1 in 9
replace seats = 0 in 9
replace treat = 0 in 9

replace partyname = "The Violets (DIE VIOLETTEN)" in 10
replace votes = 0.1 in 10
replace seats = 0 in 10
replace treat = 0 in 10

replace partyname = "Marxist–Leninist Party (MLPD)" in 11
replace votes = 0.1 in 11
replace seats = 0 in 11
replace treat = 0 in 11

replace partyname = "Alliance for Germany (Volksabstimmung)" in 12
replace votes = 0.1 in 12
replace seats = 0 in 12
replace treat = 0 in 12

replace partyname = "Free Voters (FWD)" in 13
replace votes = 0 in 13
replace seats = 0 in 13
replace treat = 0 in 13

replace partyname = "Christian Centre (CM)" in 14
replace votes = 0 in 14
replace seats = 0 in 14
replace treat = 0 in 14

replace partyname = "Centre Party (ZENTRUM)" in 15
replace votes = 0 in 15
replace seats = 0 in 15
replace treat = 0 in 15

replace partyname = "Party for Social Equality (PSG)" in 16
replace votes = 0 in 16
replace seats = 0 in 16
replace treat = 0 in 16

replace partyname = "Alliance of the Centre (ADM)" in 17
replace votes = 0 in 17
replace seats = 0 in 17
replace treat = 0 in 17

replace partyname = "German Communist Party (DKP)" in 18
replace votes = 0 in 18
replace seats = 0 in 18
replace treat = 0 in 18

** CYPRUS 2011: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING
insobs 2, before(1) 

replace countryname = "Cyprus" in 1/2
replace year = 2011 in 1/2
replace threshold = 1.7857143 in 1/2
replace edate = "22may2011" in 1/2

replace partyname = "Balance – Independent Citizens Movement" in 1
replace votes = 0.21 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "Cypriot Progressive Cooperation" in 2
replace votes = 0.18 in 2
replace seats = 0 in 2
replace treat = 0 in 2

** DENMARK 1977: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING
insobs 1, before(1) 

replace countryname = "Denmark" in 1
replace year = 1977 in 1
replace threshold = 2 in 1
replace edate = "15feb1977" in 1

replace partyname = "Pensioners' Party" in 1
replace votes = 0.9 in 1
replace seats = 0 in 1
replace treat = 0 in 1

** DENMARK 1979: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING
insobs 1, before(1) 

replace countryname = "Denmark" in 1
replace year = 1979 in 1
replace threshold = 2 in 1
replace edate = "23oct1979" in 1

replace partyname = "Communist Workers Party" in 1
replace votes = 0.4 in 1
replace seats = 0 in 1
replace treat = 0 in 1

** DENMARK 1981: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING
insobs 2, before(1) 

replace countryname = "Denmark" in 1/2
replace year = 1981 in 1/2
replace threshold = 2 in 1/2
replace edate = "08dec1981" in 1/2

replace partyname = "Communist Workers Party" in 1
replace votes = 0.1 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "Socialist Workers Party" in 2
replace votes = 0.1 in 2
replace seats = 0 in 2
replace treat = 0 in 2

* DENMARK 1984: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING
insobs 2, before(1) 

replace countryname = "Denmark" in 1/2
replace year = 1984 in 1/2
replace threshold = 2 in 1/2
replace edate = "10jan1984" in 1/2

replace partyname = "Communist Workers Party" in 1
replace votes = 0.0 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "Communist Party of Denmark/Marxist–Leninists" in 2
replace votes = 0.0 in 2
replace seats = 0 in 2
replace treat = 0 in 2

* DENMARK 1998: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING
insobs 1, before(1) 

replace countryname = "Denmark" in 1
replace year = 1998 in 1
replace threshold = 2 in 1
replace edate = "11mar1998" in 1

replace partyname = "Democratic Renewal" in 1
replace votes = 0.3 in 1
replace seats = 0 in 1
replace treat = 0 in 1

* DENMARK 2005: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING
insobs 1, before(1) 

replace countryname = "Denmark" in 1
replace year = 2005 in 1
replace threshold = 2 in 1
replace edate = "08feb2005" in 1

replace partyname = "Minority Party" in 1
replace votes = 0.3 in 1
replace seats = 0 in 1
replace treat = 0 in 1

* GEORGIA 2004: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING
* First remove wrong parties
drop if partyname == "SLP" & countryname == "Georgia" & year == 2004
drop if partyname == "DAK" & countryname == "Georgia" & year == 2004

insobs 12, before(1) 

replace countryname = "Georgia" in 1/12
replace year = 2004 in 1/12
replace threshold = 7 in 1/12
replace edate = "28mar2004" in 1/12

replace partyname = "Georgian Labour Party" in 1
replace votes = 6.14 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "National Democratic Alliance" in 2
replace votes = 2.61 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "Jumber Patiashvili – Unity" in 3
replace votes = 2.53 in 3
replace seats = 0 in 3
replace treat = 0 in 3

replace partyname = "Socialist Party of Georgia" in 4
replace votes = 0.49 in 4
replace seats = 0 in 4
replace treat = 0 in 4

replace partyname = "Nationalists" in 5
replace votes = 0.28 in 5
replace seats = 0 in 5
replace treat = 0 in 5

replace partyname = "Nodar Natadze National Front" in 6
replace votes = 0.15 in 6
replace seats = 0 in 6
replace treat = 0 in 6

replace partyname = "Party of Democratic Truth" in 7
replace votes = 0.14 in 7
replace seats = 0 in 7
replace treat = 0 in 7

replace partyname = "National Revival Bloc" in 8
replace votes = 0.12 in 8
replace seats = 0 in 8
replace treat = 0 in 8

replace partyname = "National-State Political Union of Georgia Mdzleveli" in 9
replace votes = 0.05 in 9
replace seats = 0 in 9
replace treat = 0 in 9

replace partyname = "Samshoblo Bloc" in 10
replace votes = 0.04 in 10
replace seats = 0 in 10
replace treat = 0 in 10

replace partyname = "Party of National Ideology" in 11
replace votes = 0.03 in 11
replace seats = 0 in 11
replace treat = 0 in 11

replace partyname = "Georgian Peoples' Alliance" in 12
replace votes = 0.02 in 12
replace seats = 0 in 12
replace treat = 0 in 12


* GEORGIA 2008: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING
insobs 7, before(1) 

replace countryname = "Georgia" in 1/7
replace year = 2008 in 1/7
replace threshold = 5 in 1/7
replace edate = "21may2008" in 1/7

replace partyname = "Rightist Alliance–Topadze Industrialists" in 1
replace votes = 0.93 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "Christian-Democratic Alliance" in 2
replace votes = 0.89 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "The Georgian Politics" in 3
replace votes = 0.46 in 3
replace seats = 0 in 3
replace treat = 0 in 3

replace partyname = "Traditionalists Party–Our Georgia–Women's Party" in 4
replace votes = 0.44 in 4
replace seats = 0 in 4
replace treat = 0 in 4

replace partyname = "Union of Georgian Sportsmen" in 5
replace votes = 0.19 in 5
replace seats = 0 in 5
replace treat = 0 in 5

replace partyname = "National Movement of Radical Democrats of Georgia" in 6
replace votes = 0.18 in 6
replace seats = 0 in 6
replace treat = 0 in 6

replace partyname = "Our Country" in 7
replace votes = 0.12 in 7
replace seats = 0 in 7
replace treat = 0 in 7

** AUSTRIA 1995: ADDING 3 ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING
insobs 4, before(1) 

replace countryname = "Austria" in 1/4
replace year = 1995 in 1/4
replace threshold = 4 in 1/4
replace edate = "17dec1995" in 1/4

replace partyname = "No – Civic Action Group against the sale of Austria (NEIN)" in 1
replace votes = 1.1 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "Communist Party of Austria (KPÖ) " in 2
replace votes = 0.29 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "Austrian Natural Law Party (ÖNP)" in 3
replace votes = 0 in 3
replace seats = 0 in 3
replace treat = 0 in 3


replace partyname = "The Best Party (DBP)" in 3
replace votes = 0.00 in 3
replace seats = 0 in 3
replace treat = 0 in 3


** AUSTRIA 1999: ADDING 3 ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING
insobs 3, before(1) 

replace countryname = "Austria" in 1/3
replace year = 1999 in 1/3
replace threshold = 4 in 1/3
replace edate = "03oct1999" in 1/3

replace partyname = "The Independents (DU)" in 1
replace votes = 1.02 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "No to NATO and EU – Neutral Austria Citizens' Initiative (NEIN)" in 2
replace votes = 0.42 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "Christian Voters Community (CWG)" in 3
replace votes = 0.07 in 3
replace seats = 0 in 3
replace treat = 0 in 3

** AUSTRIA 2002: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING
insobs 3, before(1) 

replace countryname = "Austria" in 1/3
replace year = 2002 in 1/3
replace threshold = 4 in 1/3
replace edate = "24nov2002" in 1/3

replace partyname = "Socialist Left Party (SLP) " in 1
replace votes = 0.08 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "The Democrats " in 2
replace votes = 0.05 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "Christian Voters Community (CWG)" in 3
replace votes = 0.04 in 3
replace seats = 0 in 3
replace treat = 0 in 3

** AUSTRIA 2006: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING
insobs 5, before(1) 

replace countryname = "Austria" in 1/5
replace year = 2006 in 1/5
replace threshold = 4 in 1/5
replace edate = "01oct2006" in 1/5

replace partyname = "EU Withdrawal – Neutral Free Austria (NFÖ)" in 1
replace votes = 0.23 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "Socialist Left Party (SLP)" in 2
replace votes = 0.05 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "Certainly – Absolutely – Independent, Franz Radinger (SAU)" in 3
replace votes = 0.03 in 3
replace seats = 0 in 3
replace treat = 0 in 3

replace partyname = "Initiative 2000 (IVE) " in 4
replace votes = 0.01 in 4
replace seats = 0 in 4
replace treat = 0 in 4

replace partyname = "List Strong (STARK) " in 5
replace votes = 0.01 in 5
replace seats = 0 in 5
replace treat = 0 in 5

** AUSTRIA 2008: ADDING ADDITIONAL NON-PARLIAMENTARY PARTIES CURRENTLY MISSING
insobs 6, before(1) 

replace countryname = "Austria" in 1/6
replace year = 2008 in 1/6
replace threshold = 4 in 1/6
replace edate = "29sep2008" in 1/6

replace partyname = "Independent Citizens' Initiative Save Austria (RETTÖ)" in 1
replace votes = 0.73 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "The Christians (DC)" in 2
replace votes = 0.64 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "Animal Rights Party (TRP) " in 3
replace votes = 0.05 in 3
replace seats = 0 in 3
replace treat = 0 in 3

replace partyname = "Left (LINKE)" in 4
replace votes = 0.04 in 4
replace seats = 0 in 4
replace treat = 0 in 4

replace partyname = "List Karlheinz Klement (KHK)" in 5
replace votes = 0.01 in 5
replace seats = 0 in 5
replace treat = 0 in 5

replace partyname = "List Strong (STARK)" in 6
replace votes = 0.00 in 6
replace seats = 0 in 6
replace treat = 0 in 6

** CROATIA: ADDING THRESHOLD TO 2000-16 ELECTIONS, CURRENTLY WITHOUT DATA ON IT
replace threshold = 5 if countryname == "Croatia" & year == 2000 
replace threshold = 5 if countryname == "Croatia" & year == 2003 
replace threshold = 5 if countryname == "Croatia" & year == 2007 
replace threshold = 5 if countryname == "Croatia" & year == 2011 
replace threshold = 5 if countryname == "Croatia" & year == 2015 
replace threshold = 5 if countryname == "Croatia" & year == 2016 

** CROATIA: ADDING PARTIES THAT DID NOT ENTER PARLIAMENT, NOW MISSING FROM DATA FROM DINAS ET AL **

* 2003
* Fix one party with incorrect vote share
replace votes = 1.95 if partyname == "HDSS" & countryname == "Croatia" & year == 2003

insobs 31, before(1) 

replace countryname = "Croatia" in 1/31
replace year = 2003 in 1/31
replace threshold = 5 in 1/31
replace edate = "23nov2003" in 1/31

replace partyname = "HIP–Croatian Bloc" in 1
replace votes = 1.53 in 1
replace seats = 0 in 1
replace treat = 0 in 1


replace partyname = "DEMOKRŠĆANI–HKDS–HGSS–HDRS–JHS" in 2
replace votes = 1.06 in 2
replace seats = 0 in 2
replace treat = 0 in 2


replace partyname = "Croatian Party of Rights 1861" in 3
replace votes = 0.76 in 3
replace seats = 0 in 3
replace treat = 0 in 3


replace partyname = "ZS–SNA POKRET ZELENIH–PGSU–ZELENI SND" in 4
replace votes = 0.66 in 4
replace seats = 0 in 4
replace treat = 0 in 4


replace partyname = "BV TREĆI BLOK–SU" in 5
replace votes = 0.63 in 5
replace seats = 0 in 5
replace treat = 0 in 5


replace partyname = "Socialist Labour Party of Croatia" in 6
replace votes = 0.63 in 6
replace seats = 0 in 6
replace treat = 0 in 6


replace partyname = "Greens of Croatia" in 7
replace votes = 0.61 in 7
replace seats = 0 in 7
replace treat = 0 in 7


replace partyname = "HPS–HP" in 8
replace votes = 0.47 in 8
replace seats = 0 in 8
replace treat = 0 in 8


replace partyname = "Democratic Social Union – Power of the People" in 9
replace votes = 0.43 in 9
replace seats = 0 in 9
replace treat = 0 in 9


replace partyname = "ASH–JSD" in 10
replace votes = 0.33 in 10
replace seats = 0 in 10
replace treat = 0 in 10

replace partyname = "Croatian Veterans' Party" in 11
replace votes = 0.25 in 11
replace seats = 0 in 11
replace treat = 0 in 11

replace partyname = "Istrian Social Democratic Forum" in 12
replace votes = 0.23 in 12
replace seats = 0 in 12
replace treat = 0 in 12

replace partyname = "Rule of Law Alliance" in 13
replace votes = 0.18 in 13
replace seats = 0 in 13
replace treat = 0 in 13

replace partyname = "POL–INS" in 14
replace votes = 0.18 in 14
replace seats = 0 in 14
replace treat = 0 in 14

replace partyname = "Croatian Independent Democrats" in 15
replace votes = 0.16 in 15
replace seats = 0 in 15
replace treat = 0 in 15

replace partyname = "Croatian Workers Party" in 16
replace votes = 0.15 in 16
replace seats = 0 in 16
replace treat = 0 in 16

replace partyname = "Democratic Party of Pensioners" in 17
replace votes = 0.15 in 17
replace seats = 0 in 17
replace treat = 0 in 17

replace partyname = "Croatian Plans Party" in 18
replace votes = 0.13 in 18
replace seats = 0 in 18
replace treat = 0 in 18

replace partyname = "Democratic Alliance of Greens" in 19
replace votes = 0.12 in 19
replace seats = 0 in 19
replace treat = 0 in 19

replace partyname = "Croatian Republican Union" in 20
replace votes = 0.09 in 20
replace seats = 0 in 20
replace treat = 0 in 20

replace partyname = "Croatian People's Peasant Party 1904" in 21
replace votes = 0.07 in 21
replace seats = 0 in 21
replace treat = 0 in 21

replace partyname = "Croatian Republicans" in 22
replace votes = 0.06 in 22
replace seats = 0 in 22
replace treat = 0 in 22

replace partyname = "Homeland Civic Party" in 23
replace votes = 0.06 in 23
replace seats = 0 in 23
replace treat = 0 in 23

replace partyname = "Croatian European Party" in 24
replace votes = 0.05 in 24
replace seats = 0 in 24
replace treat = 0 in 24

replace partyname = "Social Democratic Union of Croatia" in 25
replace votes = 0.04 in 25
replace seats = 0 in 25
replace treat = 0 in 25

replace partyname = "Christian Social Union" in 26
replace votes = 0.03 in 26
replace seats = 0 in 26
replace treat = 0 in 26

replace partyname = "Croatian Dalmatian Home" in 27
replace votes = 0.02 in 27
replace seats = 0 in 27
replace treat = 0 in 27

replace partyname = "Democratic Action of the People of Croatia" in 28
replace votes = 0.02 in 28
replace seats = 0 in 28
replace treat = 0 in 28

replace partyname = "Serb People's Party" in 29
replace votes = 0.01 in 29
replace seats = 0 in 29
replace treat = 0 in 29

replace partyname = "Independent Democratic Serb Party" in 30
replace votes = 0.01 in 30
replace seats = 0 in 30
replace treat = 0 in 30

replace partyname = "Party of Croatian Revival" in 31
replace votes = 0.01 in 31
replace seats = 0 in 31
replace treat = 0 in 31


* 2007
insobs 30, before(1) 

replace countryname = "Croatia" in 1/30
replace year = 2007 in 1/30
replace threshold = 5 in 1/30
replace edate = "25nov2007" in 1/30

replace partyname = "Democratic Centre–Greens" in 1
replace votes = 0.88 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "SU–ISDNS" in 2
replace votes = 0.88 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "Croatian Youth Party" in 3
replace votes = 0.66 in 3
replace seats = 0 in 3
replace treat = 0 in 3

replace partyname = "Only Croatia – Movement for Croatia" in 4
replace votes = 0.64 in 4
replace seats = 0 in 4
replace treat = 0 in 4

replace partyname = "Women's Democratic Party–Greens of Croatia" in 5
replace votes = 0.41 in 5
replace seats = 0 in 5
replace treat = 0 in 5

replace partyname = "LJEVICA–SRP–HSD–ISDF" in 6
replace votes = 0.4 in 6
replace seats = 0 in 6
replace treat = 0 in 6

replace partyname = "Independent Democratic Serb Party" in 7
replace votes = 0.37 in 7
replace seats = 0 in 7
replace treat = 0 in 7

replace partyname = "Croatian Veterans' Party" in 8
replace votes = 0.01 in 8
replace seats = 0 in 8
replace treat = 0 in 8

replace partyname = "Croatian Pure Party of Rights" in 9
replace votes = 0.36 in 9
replace seats = 0 in 9
replace treat = 0 in 9

replace partyname = "Authentic Croatian Peasant Party" in 10
replace votes = 0.32 in 10
replace seats = 0 in 10
replace treat = 0 in 10

replace partyname = "ASH–JSD–DSŽ–ZS–HRS" in 11
replace votes = 0.30 in 11
replace seats = 0 in 11
replace treat = 0 in 11

replace partyname = "Green List" in 12
replace votes = 0.24 in 12
replace seats = 0 in 12
replace treat = 0 in 12

replace partyname = "Youth Action" in 13
replace votes = 0.21 in 13
replace seats = 0 in 13
replace treat = 0 in 13

replace partyname = "HKDS–KSU" in 14
replace votes = 0.13 in 14
replace seats = 0 in 14
replace treat = 0 in 14

replace partyname = "Alphabet of Democracy" in 15
replace votes = 0.12 in 15
replace seats = 0 in 15
replace treat = 0 in 15

replace partyname = "Croatian Rights–Croatian Rights Movement" in 16
replace votes = 0.11 in 16
replace seats = 0 in 16
replace treat = 0 in 16

replace partyname = "PGS–SBHS–MDS–DLS" in 17
replace votes = 0.08 in 17
replace seats = 0 in 17
replace treat = 0 in 17

replace partyname = "Economic Party" in 18
replace votes = 0.07 in 18
replace seats = 0 in 18
replace treat = 0 in 18

replace partyname = "Democratic Party of the Slavonian Plain" in 19
replace votes = 0.07 in 19
replace seats = 0 in 19
replace treat = 0 in 19

replace partyname = "Croatian Christian Democratic Union" in 20
replace votes = 0.06 in 20
replace seats = 0 in 20
replace treat = 0 in 20

replace partyname = "Croatian Democratic Peasant Party" in 21
replace votes = 0.06 in 21
replace seats = 0 in 21
replace treat = 0 in 21

replace partyname = "Croatian Party of the Unemployed" in 22
replace votes = 0.05 in 22
replace seats = 0 in 22
replace treat = 0 in 22

replace partyname = "Croatian Christian Democratic Party" in 23
replace votes = 0.04 in 23
replace seats = 0 in 23
replace treat = 0 in 23

replace partyname = "Croatian European Party" in 24
replace votes = 0.03 in 24
replace seats = 0 in 24
replace treat = 0 in 24

replace partyname = "Croatian Assemby" in 25
replace votes = 0.02 in 25
replace seats = 0 in 25
replace treat = 0 in 25

replace partyname = "CGreen Alternative–Consumer Party" in 26
replace votes = 0.02 in 26
replace seats = 0 in 26
replace treat = 0 in 26

replace partyname = "Croatian Demochristians" in 27
replace votes = 0.02 in 27
replace seats = 0 in 27
replace treat = 0 in 27

replace partyname = "Homeland Civic Party" in 28
replace votes = 0.02 in 28
replace seats = 0 in 28
replace treat = 0 in 28

replace partyname = "My Little Međimurje" in 29
replace votes = 0.01 in 29
replace seats = 0 in 29
replace treat = 0 in 29

replace partyname = "Rule of Law Alliance" in 30
replace votes = 0.06 in 30
replace seats = 0 in 30
replace treat = 0 in 30

** CROATIA: ADDING 2011 ELECTION, NOW MISSING FROM DATA FROM DINAS ET AL **
* 2011
insobs 42, before(1) 

replace countryname = "Croatia" in 1/42
replace year = 2011 in 1/42
replace threshold = 5 in 1/42
replace edate = "04dec2011" in 1/42

replace partyname = "Kukuriku Coalition (SPH–HNS–LD–IDS–HSU)" in 1
replace votes = 40.72 in 1
replace seats = 80 in 1
replace treat = 1 in 1

replace partyname = "HDZ Coalition (HDZ–HGS–DC)" in 2
replace votes = 23.93  in 2
replace seats =  47 in 2
replace treat = 1  in 2

replace partyname = "Croatian Labourists – Labour Party" in 3
replace votes = 5.17  in 3
replace seats =  6 in 3
replace treat =  1 in 3

replace partyname = "Croatian Party of Rights" in 4
replace votes = 3.38 in 4
replace seats = 0  in 4
replace treat = 0  in 4

replace partyname = "HSLS–ZDS" in 5
replace votes = 3.11  in 5
replace seats =  0 in 5
replace treat =  0 in 5

replace partyname = "HSS–ZS–SP" in 6
replace votes =  3.13 in 6
replace seats = 1  in 6
replace treat = 1  in 6

replace partyname = "Croatian Democratic Alliance of Slavonia and Baranja" in 7
replace votes = 2.93  in 7
replace seats =  6 in 7
replace treat =  1 in 7

replace partyname = "BUZ–PGS–HRS" in 8
replace votes =  2.85 in 8
replace seats = 0  in 8
replace treat =  0 in 8

replace partyname = "HSP AS–HČSP" in 9
replace votes = 2.81  in 9
replace seats = 1  in 9
replace treat = 1  in 9

replace partyname = "Croatian Growth" in 10
replace votes = 1.27  in 10
replace seats = 0  in 10
replace treat =  0 in 10

replace partyname = "AM–RI–SUH–ASH" in 11
replace votes =  1.04 in 11
replace seats =  0 in 11
replace treat =  0 in 11

replace partyname = "ABH–HDS–JH" in 12
replace votes =  0.61 in 12
replace seats =  0 in 12
replace treat =  0 in 12

replace partyname = "A-HSS–SP–DPS" in 13
replace votes =  0.58 in 13
replace seats =  0 in 13
replace treat =  0 in 13

replace partyname = "Ladonja" in 14
replace votes =  0.51 in 14
replace seats =  0 in 14
replace treat =  0 in 14

replace partyname = "Women's Democratic Party" in 15
replace votes = 0.39  in 15
replace seats =  0 in 15
replace treat =  0 in 15

replace partyname = "Green List" in 16
replace votes =  0.36 in 16
replace seats =  0 in 16
replace treat =  0 in 16

replace partyname = "Independent Democratic Serb Party" in 17
replace votes =  0.33 in 17
replace seats =  0 in 17
replace treat =  0 in 17

replace partyname = "Authentic Croatian Party of Rights" in 18
replace votes = 0.25  in 18
replace seats =  0 in 18
replace treat =  0 in 18

replace partyname = "Socialist Labour Party of Croatia" in 19
replace votes =  0.22 in 19
replace seats =  0 in 19
replace treat =  0 in 19

replace partyname = "AMD–HSM" in 20
replace votes = 0.2  in 20
replace seats =  0 in 20
replace treat =  0 in 20

replace partyname = "Democratic Party of Slavonia Plain" in 21
replace votes = 0.17  in 21
replace seats =  0 in 21
replace treat =  0 in 21

replace partyname = "Croatian Democratic Peasant Party" in 22
replace votes = 0.17  in 22
replace seats =  0 in 22
replace treat =  0 in 22

replace partyname = "Alphabet of Democracy" in 23
replace votes =  0.13 in 23
replace seats =  0 in 23
replace treat =  0 in 23

replace partyname = "Croatian Green Party–Eco Green Alliance" in 2
replace votes =  0.13 in 24
replace seats =  0 in 24
replace treat =  0 in 24

replace partyname = "Zagreb Independent List" in 25
replace votes = 0.13  in 25
replace seats =  0 in 25
replace treat =  0 in 25

replace partyname = "Greens Together" in 26
replace votes =  0.12 in 26
replace seats =  0 in 26
replace treat =  0 in 26

replace partyname = "21st Century Croatia" in 27
replace votes =  0.1 in 27
replace seats =  0 in 27
replace treat =  0 in 27

replace partyname = "I Love Croatia" in 28
replace votes = 0.09  in 28
replace seats =  0 in 28
replace treat =  0 in 28

replace partyname = "National Democrats" in 29
replace votes =  0.09  in 29
replace seats =  0 in 29
replace treat =  0 in 29

replace partyname = "Croatian Union Party" in 30
replace votes =   0.08 in 30
replace seats =  0 in 30
replace treat =  0 in 30

replace partyname = "Zagorje Party" in 31
replace votes =   0.07 in 31
replace seats =  0 in 31
replace treat =  0 in 31

replace partyname = "Međimurje Democratic Alliance" in 32
replace votes =  0.07  in 32
replace seats =  0 in 32
replace treat =  0 in 32

replace partyname = "Istrian Independent Social Democratic Party" in 33
replace votes =  0.07  in 33
replace seats =  0 in 33
replace treat =  0 in 33

replace partyname = "Family Party" in 34
replace votes =   0.07 in 34
replace seats =  0 in 34
replace treat =  0 in 34

replace partyname = "Greens" in 35
replace votes =  0.06  in 35
replace seats =  0 in 35
replace treat =  0 in 35

replace partyname = "Voice of Reason" in 36
replace votes =   0.05 in 36
replace seats =  0 in 36
replace treat =  0 in 36

replace partyname = "Croatian European Party" in 37
replace votes =   0.04 in 37
replace seats =  0 in 37
replace treat =  0 in 37

replace partyname = "Croatian Christian Democratic Union" in 38
replace votes =   0.02 in 38
replace seats =  0 in 38
replace treat =  0 in 38

replace partyname = "New Croatia" in 39
replace votes =   0.02 in 39
replace seats =  0 in 39
replace treat =  0 in 39

replace partyname = "Croatia Greens" in 40
replace votes =   0.02 in 40
replace seats =  0 in 40
replace treat =  0 in 40

replace partyname = "Dalmatian Liberal Party" in 41
replace votes =   0.02 in 41
replace seats =  0 in 41
replace treat =  0 in 41

replace partyname = "Socialist Party of Croatia" in 42
replace votes =   0.01 in 42
replace seats =  0 in 42
replace treat =  0 in 42



** GEORGIA: ADDING PARTIES THAT DID NOT ENTER PARLIAMENT, NOW MISSING FROM DATA FROM DINAS ET AL **
* 2008
* Fix one wrong vote share
replace votes = 8.66 if partyname == "KDM" & countryname == "Georgia" & year == 2008
insobs 7, before(1) 

replace countryname = "Georgia" in 1/7
replace year = 2008 in 1/7
replace threshold = 5 in 1/7
replace edate = "21may2008" in 1/7

replace partyname = "Rightist Alliance–Topadze Industrialists" in 1
replace votes = 0.93 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "Christian-Democratic Alliance" in 2
replace votes = 0.299 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "The Georgian Politics" in 3
replace votes = 0.46 in 3
replace seats = 0 in 3
replace treat = 0 in 3

replace partyname = "Traditionalists Party–Our Georgia–Women's Party" in 4
replace votes = 0.44 in 4
replace seats = 0 in 4
replace treat = 0 in 4


replace partyname = "Union of Georgian Sportsmen" in 5
replace votes = 0.19 in 5
replace seats = 0 in 5
replace treat = 0 in 5


replace partyname = "National Movement of Radical Democrats of Georgia" in 6
replace votes = 0.18 in 6
replace seats = 0 in 6
replace treat = 0 in 6


replace partyname = "Our Country" in 7
replace votes = 0.12 in 7
replace seats = 0 in 7
replace treat = 0 in 7


** AUSTRIA: ADDING PARTIES THAT DID NOT ENTER PARLIAMENT, NOW MISSING FROM DATA FROM DINAS ET AL **
* 1994
insobs 4, before(1) 

replace countryname = "Austria" in 1/4
replace year = 1994 in 1/4
replace threshold = 4 in 1/4
replace edate = "09oct1994" in 1/4

replace partyname = "No – Civic Action Group against the sale of Austria (NEIN)" in 1
replace votes = 1.1 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "Communist Party of Austria (KPÖ)" in 2
replace votes = 0.29 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "Austrian Natural Law Party (ÖNP)" in 3
replace votes = 0.0 in 3
replace seats = 0 in 3
replace treat = 0 in 3

replace partyname = "The Best Party (DBP)" in 4
replace votes = 0 in 4
replace seats = 0 in 4
replace treat = 0 in 4

* 1995
insobs 8, before(1) 

replace countryname = "Austria" in 1/8
replace year = 1994 in 1/8
replace threshold = 4 in 1/8
replace edate = "09oct1994" in 1/8

replace partyname = "No – Civic Action Group against the sale of Austria (NEIN)" in 1
replace votes = 0.9 in 1
replace seats = 0 in 1
replace treat = 0 in 1

replace partyname = "Communist Party of Austria (KPÖ) " in 2
replace votes = 0.26 in 2
replace seats = 0 in 2
replace treat = 0 in 2

replace partyname = "Christian Voters' Community (CWG) " in 3
replace votes = 0.2 in 3
replace seats = 0 in 3
replace treat = 0 in 3

replace partyname = "United Greens Austria – List Adi Pinter (VGÖ)" in 4
replace votes = 0.13 in 4
replace seats = 0 in 4
replace treat = 0 in 4

replace partyname = "Austrian Natural Law Party (ÖNP)" in 5
replace votes = 0.09 in 5
replace seats = 0 in 5
replace treat = 0 in 5

replace partyname = "Citizen Greens Austria – Free Democrats (BGÖ)" in 6
replace votes = 0.05 in 6
replace seats = 0 in 6
replace treat = 0 in 6

replace partyname = "Fritz Georg " in 7
replace votes = 0.01 in 7
replace seats = 0 in 7
replace treat = 0 in 7

replace partyname = "The Best Party (DBP)" in 8
replace votes = 0.01 in 8
replace seats = 0 in 8
replace treat = 0 in 8


** GERMANY **
* Note: electoral results are for the proportional segment

* 1949
insobs 14, before(1) 

replace countryname = "Germany" in 1/14
replace country = 10 in 1/14
replace year = 1949 in 1/14
replace threshold = 5 in 1/14
replace edate = "14ago1949" in 1/14

replace partyname = "Christian Democratic Union (CDU)" in 1
replace votes = 25.19 in 1
replace seats = 115 in 1
replace treat = 1 in 1

replace partyname = "Social Democratic Party (SPD)" in 2
replace votes = 29.22 in 2
replace seats = 131 in 2
replace treat = 1 in 2

replace partyname = "Free Democratic Party (FDP)" in 3
replace votes = 11.92 in 3
replace seats = 52 in 3
replace treat = 1 in 3

replace partyname = "Christian Social Union (CSU)" in 4
replace votes = 5.82 in 4
replace seats = 24 in 4
replace treat = 1 in 4

replace partyname = "Communist Party of Germany" in 5
replace votes = 5.74 in 5
replace seats = 15 in 5
replace treat = 1 in 5

replace partyname = "German Party (DP)" in 6
replace votes = 3.96 in 6
replace seats = 17 in 6
replace treat = 1 in 6

replace partyname = "Bavaria Party" in 7
replace votes = 4.16 in 7
replace seats = 17 in 7
replace treat = 1 in 7

replace partyname = "Center Party" in 8
replace votes = 3.07 in 8
replace seats = 10 in 8
replace treat = 1 in 8

replace partyname = "Economic Reconstruction Union" in 9
replace votes = 2.87 in 9
replace seats = 12 in 9
replace treat = 1 in 9

replace partyname = "Deutsche Rechtspartei" in 10
replace votes = 1.81 in 10
replace seats = 5 in 10
replace treat = 1 in 10

replace partyname = "Radical Social Freedom Party" in 11
replace votes = 0.91 in 11
replace seats = 0 in 11
replace treat = 0 in 11

replace partyname = "South Schleswig Voters' Association (SSW)" in 12
replace votes = 0.32 in 12
replace seats = 1 in 12
replace treat = 1 in 12

replace partyname = "Rheinish-Westfalian People's Party" in 13
replace votes = 0.09 in 13
replace seats = 0 in 13
replace treat = 0 in 13

replace partyname = "European People's Movement of Germany" in 14
replace votes = 0.11 in 14
replace seats = 0 in 14
replace treat = 0 in 14

* 1953
insobs 16, before(1) 

replace countryname = "Germany" in 1/16
replace country = 10 in 1/16
replace year = 1953 in 1/16
replace threshold = 5 in 1/16
replace edate = "06sep1953" in 1/16

replace partyname = "Christian Democratic Union (CDU)" in 1
replace votes = 34.8 in 1
replace seats = 191 in 1
replace treat = 1 in 1

replace partyname = "Social Democratic Party (SPD)" in 2
replace votes = 29.5 in 2
replace seats = 151 in 2
replace treat = 1 in 2

replace partyname = "Free Democratic Party (FDP)" in 3
replace votes = 10.8 in 3
replace seats = 48 in 3
replace treat = 1 in 3

replace partyname = "Christian Social Union (CSU)" in 4
replace votes = 8.9 in 4
replace seats = 52 in 4
replace treat = 1 in 4

replace partyname = "All-German Bloc/League of Expellees and Deprived of Rights (GB/BHE)" in 5
replace votes = 5.9 in 5
replace seats = 27 in 5
replace treat = 0 in 5

replace partyname = "German Party (DP)" in 6
replace votes = 3.9 in 6
replace seats = 15 in 6
replace treat = 1 in 6

replace partyname = "Communist Party KPD" in 7
replace votes = 2.2 in 7
replace seats = 0 in 7
replace treat = 0 in 7

replace partyname = "Bavaria Party (BP)" in 8
replace votes = 1.5 in 8
replace seats = 0 in 8
replace treat = 0 in 8

replace partyname = "All-German People's Party (GVP)" in 9
replace votes = 1 in 9
replace seats = 0 in 9
replace treat = 0 in 9

replace partyname = "Deutsche Reichspartei (DRP)" in 10
replace votes = 0.7 in 10
replace seats = 0 in 10
replace treat = 0 in 10

replace partyname = "South Schleswig Voters' Association (SSW)" in 11
replace votes = 0.2 in 11
replace seats = 0 in 11
replace treat = 0 in 11

replace partyname = "Centre Party (ZENTRUM)" in 12
replace votes = 0.2 in 12
replace seats = 3 in 12
replace treat = 1 in 12

replace partyname = "Dachverband der Nationalen Sammlung (DNS)" in 13
replace votes = 0.3 in 13
replace seats = 0 in 13
replace treat = 0 in 13

replace partyname = "Schleswig-Holsteinische Bauern- und Landarbeiterdemokratie (SHBLD)" in 14
replace votes = 0.0 in 14
replace seats = 0 in 14
replace treat = 0 in 14

replace partyname = "Patriotic Union (VU)" in 15
replace votes = 0.0 in 15
replace seats = 0 in 15
replace treat = 0 in 15

replace partyname = "Party of the Good Germans (PdgD)" in 16
replace votes = 0.0 in 16
replace seats = 0 in 16
replace treat = 0 in 16


* 1957
insobs 14, before(1) 

replace countryname = "Germany" in 1/14
replace year = 1957 in 1/14
replace threshold = 5 in 1/14
replace edate = "15sep1957" in 1/14

replace partyname = "Christian Democratic Union (CDU)" in 1
replace votes = 39.7 in 1
replace seats = 215 in 1
replace treat = 1 in 1

replace partyname = "Social Democratic Party (SPD)" in 2
replace votes = 32 in 2
replace seats = 169 in 2
replace treat = 1 in 2

replace partyname = "Free Democratic Party (FDP)" in 3
replace votes = 7.5 in 3
replace seats = 41 in 3
replace treat = 1 in 3

replace partyname = "Christian Social Union (CSU)" in 4
replace votes = 10.6 in 4
replace seats = 55 in 4
replace treat = 1 in 4

replace partyname = "All-German Bloc/League of Expellees and Deprived of Rights (GB/BHE)" in 5
replace votes = 4.4 in 5
replace seats = 0 in 5
replace treat = 0 in 5

replace partyname = "German Party (DP)" in 6
replace votes = 3.5 in 6
replace seats = 17 in 6
replace treat = 1 in 6

replace partyname = "Deutsche Reichspartei (DRP)" in 7
replace votes = 1 in 7
replace seats = 0 in 7
replace treat = 0 in 7

replace partyname = "Federalist Union (FU)" in 8
replace votes = 1 in 8
replace seats = 0 in 8
replace treat = 0 in 8

replace partyname = "Alliance of Germans (BdD)" in 9
replace votes = 0.1 in 9
replace seats = 0 in 9
replace treat = 0 in 9

replace partyname = "Party of the Good Germans (PdgD)" in 10
replace votes = 0 in 10
replace seats = 0 in 10
replace treat = 0 in 10

replace partyname = "German Middle Class (Mittelstand)" in 11
replace votes = 0 in 11
replace seats = 0 in 11
replace treat = 0 in 11

replace partyname = "South Schleswig Voters' Association (SSW)" in 12
replace votes = 0.1 in 12
replace seats = 0 in 12
replace treat = 0 in 12

replace partyname = "German Community (DG)" in 13
replace votes = 0.1 in 13
replace seats = 0 in 13
replace treat = 0 in 13

replace partyname = "Patriotic Union (VU)" in 14
replace votes = 0.0 in 14
replace seats = 0 in 14
replace treat = 0 in 14




*/
********************************************************************************
******************************* 2. Updating data *******************************
********************************************************************************


** ALBANIA **

* Albania 2013. Source: OSCE Report: https://www.osce.org/odihr/elections/106963?download=true
ta party if country == 1
ta party if country == 1, nolabel
ta partyname if country == 1

insobs 8, before(99) 
replace country = 1 in 99/106
replace countryname = "Albania" in 99/106
replace year = 2013 in 99/106
replace eleccount = 7 in 99/106
replace threshold = 3 in 99/106
replace edate = "23jun2013" in 99/106

replace partyname = "Albania: LDP" in 99
replace votes = 0.06 in 99
replace seats = 0 in 99

replace partyname = "Albania: PPKDSH" in 100
replace votes = 0.02 in 100
replace seats = 0 in 100

replace partyname = "Albania: Alliance for European Albania" in 101
replace votes = 57.63 in 101
replace seats = 83 in 101

replace partyname = "Albania: Alliance for Employment, Prosperity and Integration" in 102
replace votes = 39.46 in 102
replace seats = 57 in 102

replace partyname = "Albania: AK" in 103
replace votes = 0.59 in 103
replace seats = 0 in 103

replace partyname = "Albania: FRD" in 104
replace votes = 1.70 in 104
replace seats = 0 in 104

replace partyname = "Albania: AQM" in 105
replace votes = 0.18 in 105
replace seats = 0 in 105

replace partyname = "Albania: DVP" in 106
replace votes = 0.36 in 106
replace seats = 0 in 106


* Albania 2017. Source: OSCE Report: https://www.osce.org/odihr/elections/albania/346661?download=true

insobs 18, before(209) 
replace country = 1 in 209/226
replace countryname = "Albania" in 209/226
replace year = 2017 in 209/226
replace eleccount = 8 in 209/226
replace threshold = 3 in 209/226
replace edate = "25jun2017" in 209/226

replace partyname = "Albania: LSI" in 209
replace votes = 14.20 in 209
replace seats = 19 in 209

replace partyname = "Albania: PS" in 210
replace votes = 48.3 in 210
replace seats = 74 in 210

replace partyname = "Albania: PKD" in 211
replace votes = 0.15 in 211
replace seats = 0 in 211

replace partyname = "Albania: Challenge for Albania" in 212
replace votes = 0.22 in 212
replace seats = 0 in 212

replace partyname = "Albania: PR" in 213
replace votes = 0.20 in 213
replace seats = 0 in 213

replace partyname = "Albania: PD" in 214
replace votes = 28.8 in 214
replace seats = 43 in 214

replace partyname = "Albania: Demo-Christian Union Party" in 215
replace votes = 0.06 in 215
replace seats = 0 in 215

replace partyname = "Albania: Demo-Christian Alliance Party" in 216
replace votes = 0.05 in 216
replace seats = 0 in 216

replace partyname = "Albania: PSD" in 217
replace votes = 0.95 in 217
replace seats = 1 in 217

replace partyname = "Albania: AD" in 218
replace votes = 0.03 in 218
replace seats = 0 in 218

replace partyname = "Albania: FRD" in 219
replace votes = 0.33 in 219
replace seats = 0 in 219

replace partyname = "Albania: PDS" in 220
replace votes = 0.16 in 220
replace seats = 0 in 220

replace partyname = "Albania: PDIU" in 221
replace votes = 4.81 in 221
replace seats = 3 in 221

replace partyname = "Albania: Nation Arbnore Alliance" in 222
replace votes = 0.02 in 222
replace seats = 0 in 222

replace partyname = "Albania: Ethnic Greek Minority for the Future" in 223
replace votes = 0.14 in 223
replace seats = 0 in 223

replace partyname = "Albania: PKSH" in 224
replace votes = 0.06 in 224
replace seats = 0 in 224

replace partyname = "Albania: People's Alliance for Justice" in 225
replace votes = 0.10 in 225
replace seats = 0 in 225

replace partyname = "Albania: Libra Party" in 226
replace votes = 0.10 in 226
replace seats = 0 in 226

br in 99/106
br in 209/226

** ARMENIA **
ta year if country == 2

* Armenia 2012. Source: OSCE Report: https://www.osce.org/odihr/elections/91643?download=true
insobs 9, before(227)

replace country = 2 in 227/235
replace countryname = "Armenia" in 227/235
replace year = 2012 in 227/235
replace edate = "06may2012" in 227/235
replace eleccount = 5 in 227/235
replace threshold = 5 in 227/235

replace partyname = "Armenia: BHK" in 227
replace votes = 30.2 in 227
replace seats = 37 in 227

replace partyname = "Armenia: Zh" in 228
replace votes = 5.8 in 228
replace seats = 5 in 228

replace partyname = "Armenia: HAK" in 229
replace votes = 7.1 in 229
replace seats = 7 in 229

replace partyname = "Armenia: DASHNAK" in 230
replace votes = 5.7 in 230
replace seats = 6 in 230

replace partyname = "Armenia: HDK" in 231
replace votes = 0.4 in 231
replace seats = 0 in 231

replace partyname = "Armenia: HKK" in 232
replace votes = 1.1 in 232
replace seats = 0 in 232

replace partyname = "Armenia: HHK" in 233
replace votes = 44.1 in 233
replace seats = 69 in 233

replace partyname = "Armenia: MHK" in 234
replace votes = 0.2 in 234
replace seats = 0 in 234

replace partyname = "Armenia: OEK" in 235
replace votes = 5.5 in 235
replace seats = 6 in 235

* Armenia 2017. Source: OSCE Report: https://www.osce.org/odihr/328226?download=true

insobs 9, before(236)

replace country = 2 in 236/244
replace countryname = "Armenia" in 236/244
replace year = 2017 in 236/244
replace edate = "02apr2017" in 236/244
replace eleccount = 6 in 236/244
replace threshold = 5 in 236/244 

replace partyname = "Armenia: YELK" in 236
replace votes = 7.79 in 236
replace seats = 9 in 236

replace partyname = "Armenia: Free Democrats" in 237
replace votes = 0.94 in 237
replace seats = 0 in 237

replace partyname = "Armenia: OEK" in 238
replace votes = 3.72 in 238
replace seats = 0 in 238

replace partyname = "Armenia: Tsarukyan Alliance" in 239
replace votes = 27.36 in 239
replace seats = 31 in 239

replace partyname = "Armenia: ANC-PPA Alliance" in 240
replace votes = 1.66 in 240
replace seats = 0 in 240

replace partyname = "Armenia: HHK" in 241
replace votes = 49.15 in 241
replace seats = 58 in 241

replace partyname = "Armenia: HKK" in 242
replace votes = 0.75 in 242
replace seats = 0 in 242

replace partyname = "Armenia: ORO Alliance" in 243
replace votes = 2.07 in 243
replace seats = 0 in 243

replace partyname = "Armenia: DASHNAK" in 244
replace votes = 6.57 in 244
replace seats = 7 in 244

** AUSTRIA **
ta year if country == 3

* Austria 2013. Source: Austrian Ministry of Interior: http://wahl13.bmi.gv.at/
insobs 14, before(245)

replace country = 3 in 245/258
replace countryname = "Austria" in 245/258
replace year = 2013 in 245/258
replace edate = "29sep2013" in 245/258
replace eleccount = 7 in 245/258
replace threshold = 4 in 245/258

replace partyname = "Austria: Sozialistische Partei Ésterrei" in 245
replace votes = 26.8 in 245
replace seats = 52 in 245

replace partyname = "Austria: Ésterreichische Volkspartei" in 246
replace votes = 24 in 246
replace seats = 47 in 246

replace partyname = "Austria: Freiheitliche Partei Ésterreic" in 247
replace votes = 20.5 in 247
replace seats = 40 in 247

replace partyname = "Austria: BZO" in 248
replace votes = 3.5 in 248
replace seats = 0 in 248

replace partyname = "Austria: Die GrÙne-Die GrÙne Alternativ" in 249
replace votes = 12.4 in 249
replace seats = 24 in 249

replace partyname = "Austria: Team Stronach" in 250
replace votes = 5.7 in 250
replace seats = 11 in 250

replace partyname = "Austria: NEOS" in 251
replace votes = 5 in 251
replace seats = 9 in 251

replace partyname = "Austria: Communists" in 252
replace votes = 1 in 252
replace seats = 0 in 252

replace partyname = "Austria: PIRAT" in 253
replace votes = 0.8 in 253
replace seats = 0 in 253

replace partyname = "Austria: CPO" in 254
replace votes = 0.1 in 254
replace seats = 0 in 254

replace partyname = "Austria: WANDL" in 255
replace votes = 0.1 in 255
replace seats = 0 in 255

replace partyname = "Austria: M" in 256
replace votes = 0.0 in 256
replace seats = 0 in 256

replace partyname = "Austria: EUAUS" in 257
replace votes = 0.0 in 257
replace seats = 0 in 257

replace partyname = "Austria: SLP" in 258
replace votes = 0.0 in 258
replace seats = 0 in 258

* Austria 2017. Source: Austrian Ministry of Interior: https: https://wahl17.bmi.gv.at/
insobs 14, before(259)

replace country = 3 in 259/272
replace countryname = "Austria" in 259/272
replace year = 2017 in 259/272
replace edate = "15oct2017" in 259/272
replace eleccount = 8 in 259/272
replace threshold = 4 in 259/272

replace partyname = "Austria: Sozialistische Partei Ésterrei" in 259
replace votes = 26.9 in 259
replace seats = 52 in 259

replace partyname = "Austria: Ésterreichische Volkspartei" in 260
replace votes = 31.5 in 260
replace seats = 62 in 260

replace partyname = "Austria: Freiheitliche Partei Ésterreic" in 261
replace votes = 26 in 261
replace seats = 51 in 261

replace partyname = "Austria: Die GrÙne-Die GrÙne Alternativ" in 262
replace votes = 3.8 in 262
replace seats = 0 in 262

replace partyname = "Austria: NEOS" in 262
replace votes = 5.3 in 262
replace seats = 10 in 262

replace partyname = "Austria: PILZ" in 263
replace votes = 4.4 in 263
replace seats = 8 in 263

replace partyname = "Austria: FLO" in 264
replace votes = 0.2 in 264
replace seats = 0 in 264

replace partyname = "Austria: Communists" in 265
replace votes = 0.8 in 265
replace seats = 0 in 265

replace partyname = "Austria: WEIẞE" in 266
replace votes = 0.2 in 266
replace seats = 0 in 266

replace partyname = "Austria: SLP" in 267
replace votes = 0.0 in 267
replace seats = 0 in 267

replace partyname = "Austria: EUAUS" in 268
replace votes = 0.0 in 268
replace seats = 0 in 268

replace partyname = "Austria: M" in 269
replace votes = 0.0 in 269
replace seats = 0 in 269

replace partyname = "Austria: CPO" in 270
replace votes = 0.0 in 270
replace seats = 0 in 270

replace partyname = "Austria: NBZ" in 271
replace votes = 0.1 in 271
replace seats = 0 in 271

replace partyname = "Austria: ODP" in 272
replace votes = 0.0 in 272
replace seats = 0 in 272

** BULGARIA **
ta year if country == 4

* Bulgaria 2013. Source: Election Guide.org: http://www.electionguide.org/elections/id/1661/
insobs 36, before(379)

replace country = 4 in 379/414
replace countryname = "Bulgaria" in 379/414
replace year = 2013 in 379/414
replace edate = "12may2013" in 379/414
replace eleccount = 8 in 379/414
replace threshold = 4 in 379/414

replace partyname = "Bulgaria: GERB" in 379
replace votes = 30.54 in 379
replace seats = 97 in 379

replace partyname = "Bulgaria: BSP" in 380
replace votes = 26.61 in 380
replace seats = 84 in 380

replace partyname = "Bulgaria: DPS" in 381
replace votes = 11.31 in 381
replace seats = 36 in 381

replace partyname = "Bulgaria: ATAKA" in 382
replace votes = 7.3 in 382
replace seats = 23 in 382

replace partyname = "Bulgaria: NFSB" in 383
replace votes = 3.7 in 383
replace seats = 0 in 383

replace partyname = "Bulgaria: Bulgaria for Citizens" in 384
replace votes = 3.25 in 384
replace seats = 0 in 384

replace partyname = "Bulgaria: DSB" in 385
replace votes = 2.93 in 385
replace seats = 0 in 385

replace partyname = "Bulgaria: Lider" in 386
replace votes = 1.74 in 386
replace seats = 0 in 386

replace partyname = "Bulgaria: St. George's Day-IMRO" in 387
replace votes = 1.89 in 387
replace seats = 0 in 387

replace partyname = "Bulgaria: RZS" in 388
replace votes = 1.67 in 388
replace seats = 0 in 388

replace partyname = "Bulgaria: Center–Freedom and Dignity" in 389
replace votes = 1.63 in 389
replace seats = 0 in 389

replace partyname = "Bulgaria: SDS" in 390
replace votes = 1.38 in 390
replace seats = 0 in 390

replace partyname = "Bulgaria: People's Voice" in 391
replace votes = 1.34 in 391
replace seats = 0 in 391

replace partyname = "Bulgaria: Zelenite" in 392
replace votes = 0.75 in 392
replace seats = 0 in 392

replace partyname = "Bulgaria: New Alternative" in 393
replace votes = 0.52 in 393
replace seats = 0 in 393

replace partyname = "Bulgaria: Proud Bulgaria" in 394
replace votes = 0.46 in 394
replace seats = 0 in 394

replace partyname = "Bulgaria: Movement for Civic Control" in 395
replace votes = 0.44 in 395
replace seats = 0 in 395

replace partyname = "Bulgaria: Modern Bulgaria" in 396
replace votes = 0.41 in 396
replace seats = 0 in 396

replace partyname = "Bulgaria: Liberal Alliance" in 397
replace votes = 0.25 in 397
replace seats = 0 in 397

replace partyname = "Bulgaria: BZNS" in 398
replace votes = 0.22 in 398
replace seats = 0 in 398

replace partyname = "Bulgaria: Party of Bulgarian Women" in 399
replace votes = 0.19 in 399
replace seats = 0 in 399

replace partyname = "Bulgaria: BL" in 400
replace votes = 0.17 in 400
replace seats = 0 in 400

replace partyname = "Bulgaria: SKP" in 401
replace votes = 0.17 in 401
replace seats = 0 in 401

replace partyname = "Bulgaria: United People's Party" in 402
replace votes = 0.17 in 402
replace seats = 0 in 402

replace partyname = "Bulgaria: Bulgarian Spring" in 403
replace votes = 0.12 in 403
replace seats = 0 in 403

replace partyname = "Bulgaria: Christian Party of Bulgaria" in 404
replace votes = 0.11 in 404
replace seats = 0 in 404

replace partyname = "Bulgaria: Middle European" in 405
replace votes = 0.10 in 405
replace seats = 0 in 405

replace partyname = "Bulgaria: National Democratic Party" in 406
replace votes = 0.10 in 406
replace seats = 0 in 406

replace partyname = "Bulgaria: Democratic Alternative for National Unification" in 407
replace votes = 0.10 in 407
replace seats = 0 in 407

replace partyname = "Bulgaria: National Patriotic Unit" in 408
replace votes = 0.09 in 408
replace seats = 0 in 408

replace partyname = "Bulgaria: Democratic Party" in 409
replace votes = 0.09 in 409
replace seats = 0 in 409

replace partyname = "Bulgaria: The Other Bulgaria" in 410
replace votes = 0.07 in 410
replace seats = 0 in 410

replace partyname = "Bulgaria: Cause Bulgaria" in 411
replace votes = 0.07 in 411
replace seats = 0 in 411

replace partyname = "Bulgaria: National Unity Movement" in 412
replace votes = 0.05 in 412
replace seats = 0 in 412

replace partyname = "Bulgaria: Christian Social Union" in 413
replace votes = 0.05 in 413
replace seats = 0 in 413

replace partyname = "Bulgaria: Social Democrat Party" in 414
replace votes = 0.04 in 414
replace seats = 0 in 414

* Bulgaria 2014. Source: Bulgarian Central Electoral Commission: http://results.cik.bg/pi2014/rezultati/
insobs 25, before(415)

replace country = 4 in 415/439
replace countryname = "Bulgaria" in 415/439
replace year = 2014 in 415/439
replace edate = "05oct2014" in 415/439
replace eleccount = 9 in 415/439
replace threshold = 4 in 415/439

replace partyname = "Bulgaria: GERB" in 415
replace votes = 32.67 in 415
replace seats = 84 in 415

replace partyname = "Bulgaria: BSP" in 416
replace votes = 15.4 in 416
replace seats = 39 in 416

replace partyname = "Bulgaria: DPS" in 417
replace votes = 14.84 in 417
replace seats = 38 in 417

replace partyname = "Bulgaria: RB" in 418
replace votes = 8.89 in 418
replace seats = 23 in 418

replace partyname = "Bulgaria: St. George's Day-IMRO" in 419
replace votes = 7.28 in 419
replace seats = 19 in 419

replace partyname = "Bulgaria: BWC" in 420
replace votes = 5.69 in 420
replace seats = 15 in 420

replace partyname = "Bulgaria: ATAKA" in 421
replace votes = 4.52 in 421
replace seats = 11 in 421

replace partyname = "Bulgaria: ABC" in 422
replace votes = 4.15 in 422
replace seats = 11 in 422

replace partyname = "Bulgaria: Movement 21" in 423
replace votes = 1.20 in 423
replace seats = 0 in 423

replace partyname = "Bulgaria: People's Voice" in 424
replace votes = 1.14 in 424
replace seats = 0 in 424

replace partyname = "Bulgaria: Zelenite" in 425
replace votes = 0.61 in 425
replace seats = 0 in 425

replace partyname = "Bulgaria: Republic BG" in 426
replace votes = 0.58 in 426
replace seats = 0 in 426

replace partyname = "Bulgaria: New Bulgaria" in 427
replace votes = 0.39 in 427
replace seats = 0 in 427

replace partyname = "Bulgaria: New Alternative" in 428
replace votes = 0.35 in 428
replace seats = 0 in 428

replace partyname = "Bulgaria: United Bulgaria" in 429
replace votes = 0.33 in 429
replace seats = 0 in 429

replace partyname = "Bulgaria: Bulgarian Social Democracy" in 430
replace votes = 0.29 in 430
replace seats = 0 in 430

replace partyname = "Bulgaria: Simeon II Coalition" in 431
replace votes = 0.24 in 431
replace seats = 0 in 431

replace partyname = "Bulgaria: Party of the Greens" in 432
replace votes = 0.23 in 432
replace seats = 0 in 432

replace partyname = "Bulgaria: The Rights" in 433
replace votes = 0.22 in 433
replace seats = 0 in 433

replace partyname = "Bulgaria: Coalition BL + Green Party" in 434
replace votes = 0.21 in 434
replace seats = 0 in 434

replace partyname = "Bulgaria: BNU-ND" in 435
replace votes = 0.17 in 435
replace seats = 0 in 435

replace partyname = "Bulgaria: New Force" in 436
replace votes = 0.17 in 436
replace seats = 0 in 436

replace partyname = "Bulgaria: Social Democrat Party" in 437
replace votes = 0.16 in 437
replace seats = 0 in 437

replace partyname = "Bulgaria: Community for New Bulgaria" in 438
replace votes = 0.14 in 438
replace seats = 0 in 438

replace partyname = "Bulgaria: New Time" in 439
replace votes = 0.12 in 439
replace seats = 0 in 439

* Bulgaria 2017. Source: Bulgarian Central Electoral Commission: http://results.cik.bg/pi2017/rezultati/index.html
insobs 19, before(440)

replace country = 4 in 440/459
replace countryname = "Bulgaria" in 440/459
replace year = 2017 in 440/459
replace edate = "26mar2017" in 440/459
replace eleccount = 10 in 440/459
replace threshold = 4 in 440/459

replace partyname = "Bulgaria: National Republican Party" in 440
replace votes = 0.07 in 440
replace seats = 0 in 440

replace partyname = "Bulgaria: GERB" in 441
replace votes = 32.66 in 441
replace seats = 95 in 441

replace partyname = "Bulgaria: BSP" in 442
replace votes = 27.19 in 442
replace seats = 80 in 442

replace partyname = "Bulgaria: United Patriots" in 443
replace votes = 9.07 in 443
replace seats = 27 in 443

replace partyname = "Bulgaria: DPS" in 444
replace votes = 8.99 in 444
replace seats = 26 in 444

replace partyname = "Bulgaria: Volya" in 445
replace votes = 4.15 in 445
replace seats = 12 in 445

replace partyname = "Bulgaria: RB" in 446
replace votes = 3.06 in 446
replace seats = 0 in 446

replace partyname = "Bulgaria: Yes Bulgaria!" in 447
replace votes = 2.88 in 447
replace seats = 0 in 447

replace partyname = "Bulgaria: Association DOST" in 448
replace votes = 2.86 in 448
replace seats = 0 in 448

replace partyname = "Bulgaria: New Republic" in 449
replace votes = 2.48 in 449
replace seats = 0 in 449

replace partyname = "Bulgaria: ABC" in 450
replace votes = 1.55 in 450
replace seats = 0 in 450

replace partyname = "Bulgaria: Revival" in 451
replace votes = 1.08 in 451
replace seats = 0 in 451

replace partyname = "Bulgaria: Party of the Greens" in 452
replace votes = 0.29 in 452
replace seats = 0 in 452

replace partyname = "Bulgaria: Bulgarian Spring" in 453
replace votes = 0.26 in 453
replace seats = 0 in 453

replace partyname = "Bulgaria: Forward Bulgaria Movement" in 454
replace votes = 0.19 in 454
replace seats = 0 in 454

replace partyname = "Bulgaria: Coalition of the Dissatisfied" in 455
replace votes = 0.17 in 455
replace seats = 0 in 455

replace partyname = "Bulgaria: Movement for an Equal Public Model" in 456
replace votes = 0.14 in 456
replace seats = 0 in 456

replace partyname = "Bulgaria: Bulgarian National Association" in 457
replace votes = 0.11 in 457
replace seats = 0 in 457

replace partyname = "Bulgaria: Bulgarian Democratic Center" in 458
replace votes = 0.09 in 458
replace seats = 0 in 458

replace partyname = "Bulgaria: Coalition WHO + BL + ZP" in 459
replace votes = 0.08 in 459
replace seats = 0 in 459


** CZECH REPUBLIC **

/* Czech Republic 2013. Official Czech Statistics. Number of mandates here: https://www.volby.cz/pls/ps2013/ps53?xjazyk=CZ&xv=1
													Vote shares here: https://www.volby.cz/pls/ps2013/ps2?xjazyk=CZ
*/
insobs 23, before(521)

replace country = 6 in 521/543
replace countryname = "Czech Republic" in 521/543
replace year = 2013 in 521/543
replace edate = "25oct2013" in 521/543
replace eleccount = 8 in 521/543
replace threshold = 5 in 521/543

replace partyname = "Czech Republic: CSSD" in 521
replace votes = 20.46 in 521
replace seats = 50 in 521

replace partyname = "Czech Republic: ANO 2011" in 522
replace votes = 18.66 in 522
replace seats = 47 in 522

replace partyname = "Czech Republic: KSCM" in 523
replace votes = 14.91 in 523
replace seats = 33 in 523

replace partyname = "Czech Republic: TOP09" in 524
replace votes = 12 in 524
replace seats = 26 in 524

replace partyname = "Czech Republic: ODS" in 524
replace votes = 7.73 in 524
replace seats = 16 in 524

replace partyname = "Czech Republic: Dawn of Direct Democracy" in 525
replace votes = 6.89 in 525
replace seats = 14 in 525

replace partyname = "Czech Republic: KDU-CSL" in 526
replace votes = 6.78 in 526
replace seats = 14 in 526

replace partyname = "Czech Republic: SZ" in 527
replace votes = 3.2 in 527
replace seats = 0 in 527

replace partyname = "Czech Republic: Pirate Party" in 528
replace votes = 2.66 in 528
replace seats = 0 in 528

replace partyname = "Czech Republic: Svobodni" in 529
replace votes = 2.47 in 529
replace seats = 0 in 529

replace partyname = "Czech Republic: SPOZ" in 530
replace votes = 1.51 in 530
replace seats = 0 in 530

replace partyname = "Czech Republic: DSSS" in 531
replace votes = 0.86 in 531
replace seats = 0 in 531

replace partyname = "Czech Republic: Zmena" in 532
replace votes = 0.58 in 532
replace seats = 0 in 532

replace partyname = "Czech Republic: HV" in 533
replace votes = 0.43 in 533
replace seats = 0 in 533

replace partyname = "Czech Republic: SSZR" in 534
replace votes = 0.27 in 534
replace seats = 0 in 534

replace partyname = "Czech Republic: SSCR" in 535
replace votes = 0.26 in 535
replace seats = 0 in 535

replace partyname = "Czech Republic: KC" in 536
replace votes = 0.18 in 536
replace seats = 0 in 536

replace partyname = "Czech Republic: LEV 21-NS" in 537
replace votes = 0.08 in 537
replace seats = 0 in 537

replace partyname = "Czech Republic: ANEO" in 538
replace votes = 0.02 in 538
replace seats = 0 in 538

replace partyname = "Czech Republic: PB" in 539
replace votes = 0.02 in 539
replace seats = 0 in 539

replace partyname = "Czech Republic: PB" in 540
replace votes = 0.01 in 540
replace seats = 0 in 540

replace partyname = "Czech Republic: RDS" in 541
replace votes = 0.01 in 541
replace seats = 0 in 541

replace partyname = "Czech Republic: OBCANE 2011" in 542
replace votes = 0.01 in 542
replace seats = 0 in 542

replace partyname = "Czech Republic: KAN" in 543
replace votes = 0.01 in 543
replace seats = 0 in 543

* Czech Republic 2017. Official Czech Statistics: https://www.volby.cz/pls/ps2017/ps2?xjazyk=CZ

insobs 31, before(544)

replace country = 6 in 544/574
replace countryname = "Czech Republic" in 544/574
replace year = 2017 in 544/574
replace edate = "20oct2017" in 544/574
replace eleccount = 9 in 544/574
replace threshold = 5 in 544/574

replace partyname = "Czech Republic: ANO 2011" in 544
replace votes = 29.64 in 544
replace seats = 78 in 544

replace partyname = "Czech Republic: ODS" in 545
replace votes = 11.32 in 545
replace seats = 25 in 545

replace partyname = "Czech Republic: Pirate Party" in 546
replace votes = 10.79 in 546
replace seats = 22 in 546

replace partyname = "Czech Republic: Freedom and Direct Democracy" in 547
replace votes = 10.64 in 547
replace seats = 22 in 547

replace partyname = "Czech Republic: KSCM" in 548
replace votes = 7.76 in 548
replace seats = 15 in 548

replace partyname = "Czech Republic: CSSD" in 549
replace votes = 7.27 in 549
replace seats = 15 in 549

replace partyname = "Czech Republic: KDU-CSL" in 550
replace votes = 5.8 in 550
replace seats = 10 in 550

replace partyname = "Czech Republic: TOP 09" in 551
replace votes = 5.31 in 551
replace seats = 7 in 551

replace partyname = "Czech Republic: STAN" in 552
replace votes = 5.18 in 552
replace seats = 6 in 552

replace partyname = "Czech Republic: Svobodni" in 553
replace votes = 1.56 in 553
replace seats = 0 in 553

replace partyname = "Czech Republic: SZ" in 554
replace votes = 1.46 in 554
replace seats = 0 in 554

replace partyname = "Czech Republic: SSZR" in 555
replace votes = 0.72 in 555
replace seats = 0 in 555

replace partyname = "Czech Republic: Realisté" in 556
replace votes = 0.71 in 556
replace seats = 0 in 556

replace partyname = "Czech Republic: SPOZ" in 557
replace votes = 0.36 in 557
replace seats = 0 in 557

replace partyname = "Czech Republic: Sportsmen" in 558
replace votes = 0.20 in 558
replace seats = 0 in 558

replace partyname = "Czech Republic: DSSS" in 559
replace votes = 0.20 in 559
replace seats = 0 in 559

replace partyname = "Czech Republic: Republican Party" in 560
replace votes = 0.19 in 560
replace seats = 0 in 560

replace partyname = "Czech Republic: Order of Nation-Patriotic Unit" in 561
replace votes = 0.17 in 561
replace seats = 0 in 561

replace partyname = "Czech Republic: Civic Democrati Alliance" in 562
replace votes = 0.15 in 562
replace seats = 0 in 562

replace partyname = "Czech Republic: Bloc Against Islamization" in 563
replace votes = 0.10 in 563
replace seats = 0 in 563

replace partyname = "Czech Republic: Referendum on the EU" in 564
replace votes = 0.08 in 564
replace seats = 0 in 564

replace partyname = "Czech Republic: Happy Czechia" in 565
replace votes = 0.07 in 565
replace seats = 0 in 565

replace partyname = "Czech Republic: Path of Responsible Society" in 566
replace votes = 0.07 in 566
replace seats = 0 in 566

replace partyname = "Czech Republic: Good Choice 2016" in 567
replace votes = 0.07 in 567
replace seats = 0 in 567

replace partyname = "Czech Republic: Czech National Social Party" in 568
replace votes = 0.03 in 568
replace seats = 0 in 568

replace partyname = "Czech Republic: PB" in 569
replace votes = 0.0 in 569
replace seats = 0 in 569

replace partyname = "Czech Republic: Society against Development in Prokop Valley" in 570
replace votes = 0.0 in 570
replace seats = 0 in 570

replace partyname = "Czech Republic: HAVEL" in 571
replace votes = 0.0 in 571
replace seats = 0 in 571

replace partyname = "Czech Republic: Citizen 2011" in 572
replace votes = 0.0 in 572
replace seats = 0 in 572

replace partyname = "Czech Republic: Nation Together" in 573
replace votes = 0.0 in 573
replace seats = 0 in 573

replace partyname = "Czech Republic: Czech National Front" in 574
replace votes = 0.0 in 574
replace seats = 0 in 574

** DENMARK **
* Denmark 2015. Source: Danish Radio: https://www.dr.dk/nyheder/politik/valg2015/resultat

insobs 10, before(690)

replace country = 7 in 690/699
replace countryname = "Denmark" in 690/699
replace year = 2015 in 690/699
replace edate = "18jun2015" in 690/699
replace eleccount = 17 in 690/699
replace threshold = 2 in 690/699

replace partyname = "Denmark: Social Democratic Partyæ" in 690
replace votes = 26.3 in 690
replace seats = 47 in 690

replace partyname = "Denmark: æDanish People's Partyæ" in 691
replace votes = 21.1 in 691
replace seats = 37 in 691

replace partyname = "Denmark: Liberal Party of Denmark" in 692
replace votes = 19.5 in 692
replace seats = 34 in 692

replace partyname = "Denmark: Unity List" in 693
replace votes = 7.8 in 693
replace seats = 14 in 693

replace partyname = "Denmark: New Alliance" in 694
replace votes = 7.5 in 694
replace seats = 13 in 694

replace partyname = "Denmark: Alternative" in 695
replace votes = 4.8 in 695
replace seats = 9 in 695

replace partyname = "Denmark: æDanish Social-Liberal Partyæ" in 696
replace votes = 4.6 in 696
replace seats = 8 in 696

replace partyname = "Denmark: æSocialist People's Partyæ" in 697
replace votes = 4.2 in 697
replace seats = 7 in 697

replace partyname = "Denmark: æConservative People's Partyæ" in 698
replace votes = 3.4 in 698
replace seats = 6 in 698

replace partyname = "Denmark: æChristian People's Partyæ" in 699
replace votes = 0.8 in 699
replace seats = 0 in 699

** ESTONIA 
* Estonia 2015. Source: VVK: http://rk2015.vvk.ee/

insobs 10, before(759)

replace country = 8 in 759/768
replace countryname = "Estonia" in 759/768
replace year = 2015 in 759/768
replace edate = "01mar2015" in 759/768
replace eleccount = 7 in 759/768
replace threshold = 5 in 759/768

replace partyname = "Estonia: Estonian Reform Party" in 759
replace votes = 27.7 in 759
replace seats = 30 in 759

replace partyname = "Estonia: Estonian Centre Party" in 760
replace votes = 24.8 in 760
replace seats = 27 in 760

replace partyname = "Estonia: ModeratesÊ" in 761
replace votes = 15.2 in 761
replace seats = 15 in 761

replace partyname = "Estonia: Pro Patria National CoalitionÊ" in 762
replace votes = 13.7 in 762
replace seats = 14 in 762

replace partyname = "Estonia: Free Party" in 763
replace votes = 8.7 in 763
replace seats = 8 in 763

replace partyname = "Estonia: Estonian United Left Party" in 764
replace votes = 0.1 in 764
replace seats = 0 in 764

replace partyname = "Estonia: Conservative People's Party" in 765
replace votes = 8.1 in 765
replace seats = 7 in 765

replace partyname = "Estonia: ÊEstonian GreensÊ" in 766
replace votes = 0.9 in 766
replace seats = 0 in 766

replace partyname = "Estonia: Party of People's Unity" in 767
replace votes = 0.4 in 767
replace seats = 0 in 767

replace partyname = "Estonia: Estonian Independence Party" in 768
replace votes = 0.2 in 768
replace seats = 0 in 768

** GEORGIA 
* Georgia 2012. Source: OSCE Report: https://www.osce.org/odihr/98399?download=true

insobs 16, before(770)

replace country = 9 in 770/785
replace countryname = "Georgia" in 770/785
replace year = 2012 in 770/785
replace edate = "01oct2012" in 770/785
replace eleccount = 3 in 770/785
replace threshold = 5 in 770/785

replace partyname = "Georgia: Georgian Dream" in 770
replace votes = 54.97 in 770
replace seats = 85 in 770

replace partyname = "Georgia: NMD" in 771
replace votes = 40.34 in 771
replace seats = 65 in 771

replace partyname = "Georgia: Christian Democratic Movement" in 772
replace votes = 2.05 in 772
replace seats = 0 in 772

replace partyname = "Georgia: SLP" in 773
replace votes = 1.24 in 773
replace seats = 0 in 773

replace partyname = "Georgia: NRP" in 774
replace votes = 0.43 in 774
replace seats = 0 in 774

replace partyname = "Georgia: Free Georgia" in 775
replace votes = 0.43 in 775
replace seats = 0 in 775

replace partyname = "Georgia: For a Fair Georgia" in 776
replace votes = 0.19 in 776
replace seats = 0 in 776

replace partyname = "Georgia: National Democratic Party" in 777
replace votes = 0.14 in 777
replace seats = 0 in 777

replace partyname = "Georgia: Georgian Troupe" in 778
replace votes = 0.11 in 778
replace seats = 0 in 778

replace partyname = "Georgia: Sportsmen Connection" in 779
replace votes = 0.07 in 779
replace seats = 0 in 779

replace partyname = "Georgia: Freedom Movement" in 780
replace votes = 0.05 in 780
replace seats = 0 in 780

replace partyname = "Georgia: Mereb Kostava Society" in 781
replace votes = 0.05 in 781
replace seats = 0 in 781

replace partyname = "Georgia: Future Georgia" in 782
replace votes = 0.03 in 782
replace seats = 0 in 782

replace partyname = "Georgia: Labour Council" in 783
replace votes = 0.03 in 783
replace seats = 0 in 783

replace partyname = "Georgia: People's Movement" in 784
replace votes = 0.03 in 784
replace seats = 0 in 784

replace partyname = "Georgia: People's Party" in 785
replace votes = 0.02 in 785
replace seats = 0 in 785

* Georgia 2016. Source: http://cesko.ge/res/docs/shemajamebelieng.pdf

insobs 25, before(786)

replace country = 9 in 786/810
replace countryname = "Georgia" in 786/810
replace year = 2016 in 786/810
replace edate = "08oct2016" in 786/810
replace eleccount = 4 in 786/810
replace threshold = 5 in 786/810

replace partyname = "Georgia: Georgian Dream" in 786
replace votes = 48.68 in 786
replace seats = 115 in 786

replace partyname = "Georgia: NMD" in 787
replace votes = 27.11 in 787
replace seats = 27 in 787

replace partyname = "Georgia: Alliance of Patriots of Georgia" in 788
replace votes = 5.01 in 788
replace seats = 6 in 788

replace partyname = "Georgia: Free Democrats" in 789
replace votes = 4.63 in 789
replace seats = 0 in 789

replace partyname = "Georgia: Democratic Movement-United Georgia" in 790
replace votes = 3.53 in 790
replace seats = 0 in 790

replace partyname = "Georgia: State for the People" in 791
replace votes = 3.45 in 791
replace seats = 0 in 791

replace partyname = "Georgia: SLP" in 792
replace votes = 3.14 in 792
replace seats = 0 in 792

replace partyname = "Georgia: Republican Party" in 793
replace votes = 1.55 in 793
replace seats = 0 in 793

replace partyname = "Georgia: Industry Will Save Georgia" in 794
replace votes = 0.78 in 794
replace seats = 1 in 794

replace partyname = "Georgia: National Forum" in 795
replace votes = 0.73 in 795
replace seats = 0 in 795

replace partyname = "Georgia: Georgia for Peace" in 796
replace votes = 0.22 in 796
replace seats = 0 in 796

replace partyname = "Georgia: Georgian Idea" in 797
replace votes = 0.17 in 797
replace seats = 0 in 797

replace partyname = "Georgia: Tamaz Mechiauri" in 798
replace votes = 0.16 in 798
replace seats = 0 in 798

replace partyname = "Georgia: Georgian Troupe" in 799
replace votes = 0.12 in 799
replace seats = 0 in 799

replace partyname = "Georgia: Communist Party" in 800
replace votes = 0.1 in 800
replace seats = 0 in 800

replace partyname = "Georgia: Our People, People's Party" in 801
replace votes = 0.09 in 801
replace seats = 0 in 801

replace partyname = "Georgia: Georgia Party" in 802
replace votes = 0.09 in 802
replace seats = 0 in 802

replace partyname = "Georgia: Road of Zviadi" in 803
replace votes = 0.08 in 803
replace seats = 0 in 803

replace partyname = "Georgia: United Communist Party of Georgia" in 804
replace votes = 0.08 in 804
replace seats = 0 in 804

replace partyname = "Georgia: Progressive Democratic Union" in 805
replace votes = 0.06 in 805
replace seats = 0 in 805

replace partyname = "Georgia: Mereb Kostava Society" in 806
replace votes = 0.05 in 806
replace seats = 0 in 806

replace partyname = "Georgia: People's Authority" in 807
replace votes = 0.05 in 807
replace seats = 0 in 807

replace partyname = "Georgia: Our Georgia" in 808
replace votes = 0.05 in 808
replace seats = 0 in 808

replace partyname = "Georgia: Left Alliance" in 809
replace votes = 0.04 in 809
replace seats = 0 in 809

replace partyname = "Georgia: Labour Socialist Party" in 810
replace votes = 0.04 in 810
replace seats = 0 in 810

** GERMANY **
* Germany 2013. 

insobs 25, before(1)

replace country = 10 in 1/25
replace countryname = "Germany" in 1/25
replace year = 2013 in 1/25
replace edate = "22sep2013" in 1/25
replace eleccount = 18 in 1/25
replace threshold = 5 in 1/25

replace partyname = "Free Democratic Party (FDP)" in 1
replace votes = 4.8 in 1
replace seats = 0 in 1

replace partyname = "Alternative for Germany (AfD)" in 2
replace votes = 4.7 in 2
replace seats = 0 in 2

replace partyname = "Pirate Party Germany (PIRATEN)" in 3
replace votes = 2.2 in 3
replace seats = 0 in 3

replace partyname = "National Democratic Party (NPD)" in 4
replace votes = 1.3 in 4
replace seats = 0 in 4

replace partyname = "Free Voters (FREIE WÄHLER)" in 5
replace votes = 1 in 5
replace seats = 0 in 5

replace partyname = "Human Environment Animal Protection" in 6
replace votes = 0.3 in 6
replace seats = 0 in 6

replace partyname = "Ecological Democratic Party (ÖDP)" in 7
replace votes = 0.3 in 7
replace seats = 0 in 7

replace partyname = "The Republicans (REP)" in 8
replace votes = 0.2 in 8
replace seats = 0 in 8

replace partyname = "Die PARTEI" in 9
replace votes = 0.2 in 9
replace seats = 0 in 9

replace partyname = "Pro Germany Citizens' Movement" in 10
replace votes = 0.2 in 10
replace seats = 0 in 10

replace partyname = "Bavaria Party (BP)" in 11
replace votes = 0.1 in 11
replace seats = 0 in 11

replace partyname = "Democracy by Referendum (Volksabstimmung)" in 12
replace votes = 0.1 in 12
replace seats = 0 in 12

replace partyname = "Pensioners' Party (RENTNER)" in 13
replace votes = 0.1 in 13
replace seats = 0 in 13

replace partyname = "Party of Reason (PDV)" in 14
replace votes = 0.1 in 14
replace seats = 0 in 14

replace partyname = "Marxist–Leninist Party (MLPD)" in 15
replace votes = 0.1 in 15
replace seats = 0 in 15

replace partyname = "Party of Bible-abiding Christians (PBC)" in 16
replace votes = 0 in 16
replace seats = 0 in 16

replace partyname = "Alliance for Innovation and Justice (BIG)" in 17
replace votes = 0 in 17
replace seats = 0 in 17

replace partyname = "Civil Rights Movement Solidarity (BüSo)" in 18
replace votes = 0 in 18
replace seats = 0 in 18

replace partyname = "Feminist Party (DIE FRAUEN)" in 19
replace votes = 0 in 19
replace seats = 0 in 19

replace partyname = "Party of the Non-voters (Nichtwähler)" in 20
replace votes = 0 in 20
replace seats = 0 in 20

replace partyname = "Alliance 21/RRP (Bündnis 21/RRP)" in 21
replace votes = 0 in 21
replace seats = 0 in 21

replace partyname = "The Violets (DIE VIOLETTEN)" in 22
replace votes = 0 in 22
replace seats = 0 in 22

replace partyname = "Family Party (FAMILIE)" in 23
replace votes = 0 in 23
replace seats = 0 in 23

replace partyname = "Party for Social Equality (PSG)" in 24
replace votes = 0 in 24
replace seats = 0 in 24

replace partyname = "The Right (DIE RECHTE)" in 25
replace votes = 0 in 25
replace seats = 0 in 25


* Germany 2017. Source: Bundeswahlleiter: https://www.bundeswahlleiter.de/en/bundestagswahlen/2017/ergebnisse/bund-99.html

insobs 40, before(855)

replace country = 10 in 855/894
replace countryname = "Germany" in 855/894
replace year = 2017 in 855/894
replace edate = "24sep2017" in 855/894
replace eleccount = 18 in 855/894
replace threshold = 5 in 855/894

replace partyname = "Germany: CDU/CSU Christian Democratic U" in 855
replace votes = 33 in 855
replace seats = 246 in 855

replace partyname = "Germany: Sozialdemokratische Partei Deu" in 856
replace votes = 20.5 in 856
replace seats = 153 in 856

replace partyname = "Germany: AfD" in 857
replace votes = 12.6 in 857
replace seats = 94 in 857

replace partyname = "Germany: Freie Demokratische Partei" in 858
replace votes = 10.7 in 858
replace seats = 80 in 858

replace partyname = "Germany: The Left" in 859
replace votes = 9.2 in 859
replace seats = 69 in 859

replace partyname = "Germany: Die GrÙnen" in 860
replace votes = 8.8 in 860
replace seats = 66 in 860

replace partyname = "Germany: Free Voters" in 861
replace votes = 1 in 861
replace seats = 0 in 861

replace partyname = "Germany: Die Partei" in 862
replace votes = 1 in 862
replace seats = 0 in 862

replace partyname = "Germany: Animal Protecion Party" in 863
replace votes = 0.8 in 863
replace seats = 0 in 863

replace partyname = "Germany: NDP" in 864
replace votes = 0.4 in 864
replace seats = 0 in 864

replace partyname = "Germany: Pirate party" in 865
replace votes = 0.4 in 865
replace seats = 0 in 865

replace partyname = "Germany: Ecological Democratic Party" in 866
replace votes = 0.3 in 866
replace seats = 0 in 866

replace partyname = "Germany: Basic Income Alliance" in 867
replace votes = 0.2 in 867
replace seats = 0 in 867

replace partyname = "Germany: V-Partei" in 868
replace votes = 0.1 in 868
replace seats = 0 in 868

replace partyname = "Germany: German Centre" in 869
replace votes = 0.1 in 869
replace seats = 0 in 869

replace partyname = "Germany: Democracy in Motion" in 870
replace votes = 0.1 in 870
replace seats = 0 in 870

replace partyname = "Germany: Bavaria Party" in 871
replace votes = 0.1 in 871
replace seats = 0 in 871

replace partyname = "Germany: AD-Democrats" in 872
replace votes = 0.1 in 872
replace seats = 0 in 872

replace partyname = "Germany: Animal Protection Alliance" in 873
replace votes = 0.1 in 873
replace seats = 0 in 873

replace partyname = "Germany: Marxist Leninist Party" in 874
replace votes = 0.1 in 874
replace seats = 0 in 874

replace partyname = "Germany: Party for Health Research" in 875
replace votes = 0.1 in 875
replace seats = 0 in 875

replace partyname = "Germany: German Communist Party" in 876
replace votes = 0.0 in 876
replace seats = 0 in 876

replace partyname = "Germany: Human World" in 877
replace votes = 0.0 in 877
replace seats = 0 in 877

replace partyname = "Germany: The Greys" in 878
replace votes = 0.0 in 878
replace seats = 0 in 878

replace partyname = "Germany: Bürgerrechtsbewegung Solidarität" in 879
replace votes = 0.0 in 879
replace seats = 0 in 879

replace partyname = "Germany: The Humanists" in 880
replace votes = 0.0 in 880
replace seats = 0 in 880

replace partyname = "Germany: Magdeburger Garden Party" in 881
replace votes = 0.0 in 881
replace seats = 0 in 881

replace partyname = "Germany: Alliance for Germany" in 882
replace votes = 0.0 in 882
replace seats = 0 in 882

replace partyname = "Germany: You Party" in 883
replace votes = 0.0 in 883
replace seats = 0 in 883

replace partyname = "Germany: The Right" in 884
replace votes = 0.0 in 884
replace seats = 0 in 884

replace partyname = "Germany: Socialist Equality Party" in 885
replace votes = 0.0 in 885
replace seats = 0 in 885

replace partyname = "Germany: UberPartei" in 886
replace votes = 0.0 in 886
replace seats = 0 in 886

replace partyname = "Germany: Party of Reason" in 887
replace votes = 0.0 in 887
replace seats = 0 in 887

replace partyname = "Germany: The Violet" in 888
replace votes = 0.0 in 888
replace seats = 0 in 888

replace partyname = "Germany: Alliance C" in 889
replace votes = 0.0 in 889
replace seats = 0 in 889

replace partyname = "Germany: New Liberals" in 890
replace votes = 0.0 in 890
replace seats = 0 in 890

replace partyname = "Germany: The Union" in 891
replace votes = 0.0 in 891
replace seats = 0 in 891

replace partyname = "Germany: Family Party" in 892
replace votes = 0.0 in 892
replace seats = 0 in 892

replace partyname = "Germany: The Women's Party" in 893
replace votes = 0.0 in 893
replace seats = 0 in 893

replace partyname = "Germany: Renter's Party" in 894
replace votes = 0.0 in 894
replace seats = 0 in 894

** HUNGARY **
* Hungary 2014. Source: OSCE Report: https://www.osce.org/odihr/elections/hungary/121098?download=true

insobs 18, before(947)

replace country = 12 in 947/964
replace countryname = "Hungary" in 947/964
replace year = 2014 in 947/964
replace edate = "06apr2014" in 947/964
replace eleccount = 7 in 947/964
replace threshold = 5 in 947/964

replace partyname = "Hungary: FIDESZ-KDNP" in 947
replace votes = 45.05 in 947
replace seats = 133 in 947

replace partyname = "Hungary: Coalition MSZP-EGYÜTT-DK-PM" in 948
replace votes = 25.67 in 948
replace seats = 38 in 948

replace partyname = "Hungary: MIEP/JOBBIK" in 949
replace votes = 20.3 in 949
replace seats = 23 in 949

replace partyname = "Hungary: LMP" in 950
replace votes = 5.36 in 950
replace seats = 5 in 950

replace partyname = "Hungary: Workers' Party" in 951
replace votes = 0.56 in 951
replace seats = 0 in 951

replace partyname = "Hungary: Hungary is not for Sale" in 952
replace votes = 0.47 in 952
replace seats = 0 in 952

replace partyname = "Hungary: SMS" in 953
replace votes = 0.44 in 953
replace seats = 0 in 953

replace partyname = "Hungary: Green Party" in 954
replace votes = 0.37 in 954
replace seats = 0 in 954

replace partyname = "Hungary: MSZDP" in 955
replace votes = 0.3 in 955
replace seats = 0 in 955

replace partyname = "Hungary: Together 2014" in 956
replace votes = 0.28 in 956
replace seats = 0 in 956

replace partyname = "Hungary: SEM" in 957
replace votes = 0.25 in 957
replace seats = 0 in 957

replace partyname = "Hungary: KTI" in 958
replace votes = 0.22 in 958
replace seats = 0 in 958

replace partyname = "Hungary: JESZ" in 959
replace votes = 0.2 in 959
replace seats = 0 in 959

replace partyname = "Hungary: MCP" in 960
replace votes = 0.18 in 960
replace seats = 0 in 960

replace partyname = "Hungary: FKGP" in 961
replace votes = 0.16 in 961
replace seats = 0 in 961

replace partyname = "Hungary: Unity" in 962
replace votes = 0.13 in 962
replace seats = 0 in 962

replace partyname = "Hungary: UDP" in 963
replace votes = 0.04 in 963
replace seats = 0 in 963

replace partyname = "Hungary: UMP" in 964
replace votes = 0.03 in 964
replace seats = 0 in 964

* Hungary 2018. Source: Hungarian Electoral Office: http://www.valasztas.hu/dyn/pv18/szavossz/hu/l22.html
* note: I include only parties that ran in the party list system. Parties that ran only in FPTP were not included

insobs 36, before(965)

replace country = 12 in 965/1000
replace countryname = "Hungary" in 965/1000
replace year = 2018 in 965/1000
replace edate = "08apr2018" in 965/1000
replace eleccount = 8 in 965/1000
replace threshold = 5 in 965/1000

replace partyname = "Hungary: FIDESZ-KDNP" in 965
replace votes = 49.27 in 965
replace seats = 133 in 965

replace partyname = "Hungary: MIEP/JOBBIK" in 966
replace votes = 19.06 in 966
replace seats = 26 in 966

replace partyname = "Hungary: MSZP" in 967
replace votes = 11.91 in 967
replace seats = 12 in 967

replace partyname = "Hungary: LMP" in 968
replace votes = 7.06 in 968
replace seats = 7 in 968

replace partyname = "Hungary: DK" in 969
replace votes = 5.38 in 969
replace seats = 6 in 969

replace partyname = "Hungary: Momentum Movement" in 970
replace votes = 3.06 in 970
replace seats = 0 in 970

replace partyname = "Hungary: Two-Tailed Dog Party" in 971
replace votes = 1.73 in 971
replace seats = 0 in 971

replace partyname = "Hungary: Together Party" in 972
replace votes = 0.66 in 972
replace seats = 1 in 972

replace partyname = "Hungary: MNOO" in 973
replace votes = 0.46 in 973
replace seats = 1 in 973

replace partyname = "Hungary: Workers' Party" in 974
replace votes = 0.27 in 974
replace seats = 0 in 974

replace partyname = "Hungary: Family Party" in 975
replace votes = 0.19 in 975
replace seats = 0 in 975

replace partyname = "Hungary: MIEP/JOBBIK" in 976
replace votes = 0.15 in 976
replace seats = 0 in 976

replace partyname = "Hungary: Party for a Fit Healthy Hungary" in 977
replace votes = 0.13 in 977
replace seats = 0 in 977

replace partyname = "Hungary: National Self-Government of Roma" in 978
replace votes = 0.1 in 978
replace seats = 0 in 978

replace partyname = "Hungary: Tenni Akarás Mozgalom" in 979
replace votes = 0.09 in 979
replace seats = 0 in 979

replace partyname = "Hungary: Roma Party of Hungary" in 980
replace votes = 0.07 in 980
replace seats = 0 in 980

replace partyname = "Hungary: Common Ground Party" in 981
replace votes = 0.07 in 981
replace seats = 0 in 981

replace partyname = "Hungary: Eye Party" in 982
replace votes = 0.05 in 982
replace seats = 0 in 982

replace partyname = "Hungary: KOSSZ" in 983
replace votes = 0.05 in 983
replace seats = 0 in 983

replace partyname = "Hungary: Iránytű" in 984
replace votes = 0.03 in 984
replace seats = 0 in 984

replace partyname = "Hungary: National Self-Government of Croats" in 985
replace votes = 0.03 in 985
replace seats = 0 in 985

replace partyname = "Hungary: Order Party" in 986
replace votes = 0.03 in 986
replace seats = 0 in 986

replace partyname = "Hungary: Unity" in 987
replace votes = 0.02 in 987
replace seats = 0 in 987

replace partyname = "Hungary: Medete" in 988
replace votes = 0.02 in 988
replace seats = 0 in 988

replace partyname = "Hungary: National Self-Government of Slovaks" in 989
replace votes = 0.02 in 989
replace seats = 0 in 989

replace partyname = "Hungary: EU.ROM" in 990
replace votes = 0.02 in 990
replace seats = 0 in 990

replace partyname = "Hungary: NP" in 991
replace votes = 0.02 in 991
replace seats = 0 in 991

replace partyname = "Hungary: National Self-Government of Russians" in 992
replace votes = 0.01 in 992
replace seats = 0 in 992

replace partyname = "Hungary: National Authority of Roma in Hungary" in 993
replace votes = 0.01 in 993
replace seats = 0 in 993

replace partyname = "Hungary: National Self-Government of Serbs" in 994
replace votes = 0.01 in 994
replace seats = 0 in 994

replace partyname = "Hungary: National Self-Government of Ukrainians" in 995
replace votes = 0 in 995
replace seats = 0 in 995

replace partyname = "Hungary: National Self-Government of Poles" in 996
replace votes = 0 in 996
replace seats = 0 in 996

replace partyname = "Hungary: National Self-Government of Slovenes" in 997
replace votes = 0 in 997
replace seats = 0 in 997

replace partyname = "Hungary: National Authority of Hungarian Churches" in 998
replace votes = 0.01 in 998
replace seats = 0 in 998

replace partyname = "Hungary: National Self-Government of Armenians" in 999
replace votes = 0 in 999
replace seats = 0 in 999

replace partyname = "Hungary: National Self-Government of Bulgarians" in 1000
replace votes = 0 in 1000
replace seats = 0 in 1000

** ICELAND **
* Iceland 2013. Source: National Electoral Commission: https://www.landskjor.is/media/frettir/ElectionsResults_April27_2013.pdf
insobs 15, before(1)

replace country = 13 in 1/15
replace countryname = "Iceland" in 1/15
replace year = 2013 in 1/15
replace edate = "27apr2013" in 1/15
replace eleccount = 4 in 1/15
replace threshold = 5 in 1/15

replace partyname = "Iceland: Bright Future" in 1
replace votes = 8.2 in 1
replace seats = 6 in 1

replace partyname = "Iceland: FSF (Progressive Party)" in 2
replace votes = 24.4 in 2
replace seats = 19 in 2

replace partyname = "Iceland: SSF (Independence Party)" in 3
replace votes = 26.7 in 3
replace seats = 19 in 3

replace partyname = "Iceland: The Right Green People's Party" in 4
replace votes = 1.7 in 4
replace seats = 0 in 4

replace partyname = "Iceland: The Humanist Party" in 5
replace votes = 0.1 in 5
replace seats = 0 in 5

replace partyname = "Iceland: The Households' Party" in 6
replace votes = 3 in 6
replace seats = 0 in 6

replace partyname = "Iceland: The Rainbow Party" in 7
replace votes = 1.1 in 7
replace seats = 0 in 7

replace partyname = "Iceland: The Sturla Jonsson's Party" in 8
replace votes = 0.1 in 8
replace seats = 0 in 8

replace partyname = "Iceland: The Iceland Democratic Party" in 9
replace votes = 2.5 in 9
replace seats = 0 in 9

replace partyname = "Iceland: Provincial Party" in 10
replace votes = 0.2 in 10
replace seats = 0 in 10

replace partyname = "Iceland: The People's Front of Iceland" in 11
replace votes = 0.2 in 11
replace seats = 0 in 11

replace partyname = "Iceland: Social Democratic Alliance" in 12
replace votes = 12.9 in 12
replace seats = 20 in 12

replace partyname = "Iceland: Dawn" in 13
replace votes = 3.1 in 13
replace seats = 0 in 13

replace partyname = "Iceland: VG (Left-Green Movement)" in 14
replace votes = 10.9 in 14
replace seats = 7 in 14

replace partyname = "Iceland: The Pirate Party" in 15
replace votes = 5.1 in 15
replace seats = 3 in 15

** ICELAND **
* Iceland 2016. Source: Iceland Monitor: https://icelandmonitor.mbl.is/news/elections-2016-results/
insobs 12, before(1)

replace country = 13 in 1/12
replace countryname = "Iceland" in 1/12
replace year = 2016 in 1/12
replace edate = "26oct2016" in 1/12
replace eleccount = 5 in 1/12
replace threshold = 5 in 1/12

replace partyname = "Iceland: SSF (Independence Party)" in 1
replace votes = 29 in 1
replace seats = 21 in 1

replace partyname = "Iceland: VG (Left-Green Movement)" in 2
replace votes = 15.9 in 2
replace seats = 10 in 2

replace partyname = "Iceland: The Pirate Party" in 3
replace votes = 14.5 in 3
replace seats = 10 in 3

replace partyname = "Iceland: FSF (Progressive Party)" in 4
replace votes = 11.5 in 4
replace seats = 8 in 4

replace partyname = "Iceland: Reform Party" in 5
replace votes = 10.5 in 5
replace seats = 7 in 5

replace partyname = "Iceland: Bright Future" in 6
replace votes = 7.2 in 6
replace seats = 4 in 6

replace partyname = "Iceland: Social Democratic Alliance" in 7
replace votes = 5.7 in 7
replace seats = 3 in 7

replace partyname = "Iceland: People's Party" in 8
replace votes = 3.5 in 8
replace seats = 0 in 8

replace partyname = "Iceland: Dawn" in 9
replace votes = 1.7 in 9
replace seats = 0 in 9

replace partyname = "Iceland: The People's Front of Iceland" in 10
replace votes = 0.3 in 10
replace seats = 0 in 10

replace partyname = "Iceland: Icelandic National Front" in 11
replace votes = 0.2 in 11
replace seats = 0 in 11

replace partyname = "Iceland: The Humanist Party" in 12
replace votes = 0.0 in 12
replace seats = 0 in 12

* Iceland 2017. Source: OSCE Report: https://www.osce.org/odihr/elections/iceland/374101?download=true
insobs 11, before(1)

replace country = 13 in 1/11
replace countryname = "Iceland" in 1/11
replace year = 2017 in 1/11
replace edate = "28oct2017" in 1/11
replace eleccount = 6 in 1/11
replace threshold = 5 in 1/11

replace partyname = "Iceland: Bright Future" in 1
replace votes = 1.2 in 1
replace seats = 0 in 1

replace partyname = "Iceland: FSF (Progressive Party)" in 2
replace votes = 10.7 in 2
replace seats = 8 in 2

replace partyname = "Iceland: Reform" in 3
replace votes = 6.7 in 3
replace seats = 8 in 3

replace partyname = "Iceland: SSF (Independence Party)" in 4
replace votes = 25.2 in 4
replace seats = 16 in 4

replace partyname = "Iceland: People's Party" in 5
replace votes = 6.9 in 5
replace seats = 4 in 5

replace partyname = "Iceland: Central Party" in 6
replace votes = 10.9 in 6
replace seats = 7 in 6

replace partyname = "Iceland: The Pirate Party" in 7
replace votes = 9.2 in 7
replace seats = 6 in 7

replace partyname = "Iceland: People's Front of Iceland" in 8
replace votes = 0.2 in 8
replace seats = 0 in 8

replace partyname = "Iceland: Social Democratic Alliance" in 9
replace votes = 12.1 in 9
replace seats = 7 in 9

replace partyname = "Iceland: Dawn" in 10
replace votes = 0.1 in 10
replace seats = 0 in 10

replace partyname = "Iceland: VG (Left-Green Movement)" in 11
replace votes = 16.9 in 11
replace seats = 11 in 11

** ISRAEL **
* Israel 2013. I could not find any results in a language that I could even remotely read. 
* Could only find Wikipedia, which is what I ended up using.
* It says it uses official data but maybe we should double check this, as I don't really trust it.
insobs 32, before(1)

replace country = 14 in 1/32
replace countryname = "Israel" in 1/32
replace year = 2013 in 1/32
replace edate = "22jan2013" in 1/32
replace eleccount = 19 in 1/32
replace threshold = 2 in 1/32

replace partyname = "Israel: LIKUD" in 1
replace votes = 23.34 in 1
replace seats = 31 in 1

replace partyname = "Israel: Yesh Atid" in 2
replace votes = 14.33 in 2
replace seats = 19 in 2

replace partyname = "Israel: Labour Party" in 3
replace votes = 11.39 in 3
replace seats = 15 in 3

replace partyname = "Israel: The Jewish Home" in 4
replace votes = 9.12 in 4
replace seats = 12 in 4

replace partyname = "Israel: SHAS" in 5
replace votes = 8.75 in 5
replace seats = 11 in 5

replace partyname = "Israel: UTJ" in 6
replace votes = 5.16 in 6
replace seats = 7 in 6

replace partyname = "Israel: Hatnuah" in 7
replace votes = 4.99 in 7
replace seats = 6 in 7

replace partyname = "Israel: MERETZ" in 8
replace votes = 4.55 in 8
replace seats = 6 in 8

replace partyname = "Israel: UAL" in 9
replace votes = 3.65 in 9
replace seats = 4 in 9

replace partyname = "Israel: HADASH" in 10
replace votes = 2.99 in 10
replace seats = 4 in 10

replace partyname = "Israel: BALAD" in 11
replace votes = 2.56 in 11
replace seats = 3 in 11

replace partyname = "Israel: Kadima" in 12
replace votes = 2.09 in 12
replace seats = 2 in 12

replace partyname = "Israel: Otzma LeYisrael" in 13
replace votes = 1.76 in 13
replace seats = 0 in 13

replace partyname = "Israel: Ame Shalem" in 14
replace votes = 1.76 in 14
replace seats = 0 in 14

replace partyname = "Israel: GLP" in 15
replace votes = 1.15 in 15
replace seats = 0 in 15

replace partyname = "Israel: Eretz Hadasha" in 16
replace votes = 0.74 in 16
replace seats = 0 in 16

replace partyname = "Israel: Koah Lehashpi'a" in 17
replace votes = 0.74 in 17
replace seats = 0 in 17

replace partyname = "Israel: HaYisraelim" in 18
replace votes = 0.5 in 18
replace seats = 0 in 18

replace partyname = "Israel: The Greens" in 19
replace votes = 0.21 in 19
replace seats = 0 in 19

replace partyname = "Israel: Gil" in 20
replace votes = 0.16 in 20
replace seats = 0 in 20

replace partyname = "Israel: Living With Dignity" in 21
replace votes = 0.1 in 21
replace seats = 0 in 21

replace partyname = "Israel: Da'am Workers Party" in 22
replace votes = 0.09 in 22
replace seats = 0 in 22

replace partyname = "Israel: We Are Brothers" in 23
replace votes = 0.08 in 23
replace seats = 0 in 23

replace partyname = "Israel: Social Justice" in 24
replace votes = 0.08 in 24
replace seats = 0 in 24

replace partyname = "Israel: We Are All Friends" in 25
replace votes = 0.06 in 25
replace seats = 0 in 25

replace partyname = "Israel: Pirate Party" in 26
replace votes = 0.05 in 26
replace seats = 0 in 26

replace partyname = "Israel: Finance Party" in 27
replace votes = 0.05 in 27
replace seats = 0 in 27

replace partyname = "Israel: Leader Party" in 28
replace votes = 0.04 in 28
replace seats = 0 in 28

replace partyname = "Israel: Light Party" in 29
replace votes = 0.03 in 29
replace seats = 0 in 29

replace partyname = "Israel: Brit Olam" in 30
replace votes = 0.02 in 30
replace seats = 0 in 30

replace partyname = "Israel: Hope for Change" in 31
replace votes = 0.02 in 31
replace seats = 0 in 31

replace partyname = "Israel: Moreshot Avot" in 32
replace votes = 0.01 in 32
replace seats = 0 in 32

* Israel 2015. I could not find any results in a language that I could even remotely read. 
* Could only find Wikipedia, which is what I ended up using.
* It says it uses official data but maybe we should double check this, as I don't really trust it.
insobs 25, before(1)

replace country = 14 in 1/25
replace countryname = "Israel" in 1/25
replace year = 2015 in 1/25
replace edate = "17mar2015" in 1/25
replace eleccount = 20 in 1/25
replace threshold = 3.25 in 1/25

replace partyname = "Israel: LIKUD" in 1
replace votes = 23.4 in 1
replace seats = 30 in 1

replace partyname = "Israel: Zionist Union" in 2
replace votes = 18.67 in 2
replace seats = 24 in 2

replace partyname = "Israel: Joint List" in 3
replace votes = 10.61 in 3
replace seats = 13 in 3

replace partyname = "Israel: Yesh Atid" in 4
replace votes = 8.82 in 4
replace seats = 11 in 4

replace partyname = "Israel: Kulanu" in 5
replace votes = 7.49 in 5
replace seats = 11 in 5

replace partyname = "Israel: The Jewish Home" in 6
replace votes = 6.74 in 6
replace seats = 8 in 6

replace partyname = "Israel: SHAS" in 7
replace votes = 5.74 in 7
replace seats = 7 in 7

replace partyname = "Israel: Beitenu" in 8
replace votes = 5.1 in 8
replace seats = 6 in 8

replace partyname = "Israel: UTJ" in 9
replace votes = 4.99 in 9
replace seats = 6 in 9

replace partyname = "Israel: Social Leadership" in 10
replace votes = 0.01 in 10
replace seats = 0 in 10

replace partyname = "Israel: MERETZ" in 11
replace votes = 3.93 in 11
replace seats = 5 in 11

replace partyname = "Israel: Yachad" in 12
replace votes = 2.97 in 12
replace seats = 0 in 12

replace partyname = "Israel: GLP" in 13
replace votes = 1.12 in 13
replace seats = 0 in 13

replace partyname = "Israel: Arab List" in 14
replace votes = 0.11 in 14
replace seats = 0 in 14

replace partyname = "Israel: The Greens" in 15
replace votes = 0.07 in 15
replace seats = 0 in 15

replace partyname = "Israel: We Are All Friends" in 16
replace votes = 0.06 in 16
replace seats = 0 in 16

replace partyname = "Israel: U'Bizchutan" in 17
replace votes = 0.04 in 17
replace seats = 0 in 17

replace partyname = "Israel: Hope for Change" in 18
replace votes = 0.03 in 18
replace seats = 0 in 18

replace partyname = "Israel: Pirate Party" in 19
replace votes = 0.03 in 19
replace seats = 0 in 19

replace partyname = "Israel: Flower Party" in 20
replace votes = 0.03 in 20
replace seats = 0 in 20

replace partyname = "Israel: Brit Olam" in 21
replace votes = 0.03 in 21
replace seats = 0 in 21

replace partyname = "Israel: Light Party" in 22
replace votes = 0.01 in 22
replace seats = 0 in 22

replace partyname = "Israel: Living With Dignity" in 23
replace votes = 0.01 in 23
replace seats = 0 in 23

replace partyname = "Israel: Economy Party" in 24
replace votes = 0.01 in 24
replace seats = 0 in 24

replace partyname = "Israel: Democratura" in 25
replace votes = 0.01 in 25
replace seats = 0 in 25

** ITALY **
* Italy 2013. Source: Ministry for Internal Affairs: https://elezionistorico.interno.gov.it/index.php?tpel=C&dtel=24/02/2013&tpa=I&tpe=A&lev0=0&levsut0=0&es0=S&ms=S
** 1. 12 seats are reserved for the external constituency, seats were added to the seats obtained by existing parties in the italian constituency (1) or party name, votes, and seats were added in the case where parties compete only in the external constituency (2)
insobs 47, before(1)

replace country = 15 in 1/47
replace countryname = "Italy" in 1/47
replace year = 2013 in 1/47
replace edate = "24feb2013" in 1/47
replace eleccount = 6 in 1/47
replace threshold = 4 in 1/47

replace partyname = "Italy: PD" in 1
replace votes = 25.43 in 1
replace seats = 297 in 1

replace partyname = "Italy: SEL" in 2
replace votes = 3.2 in 2
replace seats = 37 in 2

replace partyname = "Italy: CD" in 3
replace votes = 0.49 in 3
replace seats = 6 in 3

replace partyname = "Italy: SVP" in 4
replace votes = 0.43 in 4
replace seats = 5 in 4

*"Il Popolo Della Liberta replace new name of Forza Italia*
replace partyname = "Italy: FI" in 5
replace votes = 21.56 in 5
replace seats = 98 in 5

replace partyname = "Italy: LN" in 6
replace votes = 4.09 in 6
replace seats = 18 in 6

replace partyname = "Italy: FDI" in 7
replace votes = 1.96 in 7
replace seats = 9 in 7

replace partyname = "Italy: La Destra" in 8
replace votes = 0.65 in 8
replace seats = 0 in 8

replace partyname = "Italy: GS" in 9
replace votes = 0.44 in 9
replace seats = 0 in 9

replace partyname = "Italy: MIR" in 10
replace votes = 0.24 in 10
replace seats = 0 in 10

replace partyname = "Italy: PP" in 11
replace votes = 0.16 in 11
replace seats = 0 in 11

replace partyname = "Italy: IP" in 12
replace votes = 0.08 in 12
replace seats = 0 in 12

replace partyname = "Italy: LPIE" in 13
replace votes = 0.01 in 13
replace seats = 0 in 13

replace partyname = "Italy: M5S" in 14
replace votes = 25.56 in 14
replace seats = 109 in 14

replace partyname = "Italy: SC" in 15
replace votes = 8.3 in 15
replace seats = 39 in 15

replace partyname = "Italy: UD" in 16
replace votes = 1.79 in 16
replace seats = 8 in 16

replace partyname = "Italy: FLI" in 17
replace votes = 0.47 in 17
replace seats = 0 in 17

replace partyname = "Italy: RC" in 18
replace votes = 2.25 in 18
replace seats = 0 in 18

replace partyname = "Italy: FFD" in 19
replace votes = 1.12 in 19
replace seats = 0 in 19

replace partyname = "Italy: PCL" in 20
replace votes = 0.26 in 20
replace seats = 0 in 20

replace partyname = "Italy: FN" in 21
replace votes = 0.26 in 21
replace seats = 0 in 21

replace partyname = "Italy: LAGL" in 22
replace votes = 0.19 in 22
replace seats = 0 in 22

replace partyname = "Italy: DF" in 23
replace votes = 0.14 in 23
replace seats = 0 in 23

replace partyname = "Italy: CI" in 24
replace votes = 0.14 in 24
replace seats = 0 in 24

replace partyname = "Italy: FT" in 25
replace votes = 0.13 in 25
replace seats = 0 in 25

replace partyname = "Italy: IAI" in 26
replace votes = 0.13 in 26
replace seats = 0 in 26

replace partyname = "Italy: IV" in 27
replace votes = 0.1 in 27
replace seats = 0 in 27

replace partyname = "Italy: PLI" in 28
replace votes = 0.08 in 28
replace seats = 0 in 28

replace partyname = "Italy: PSDAZ" in 29
replace votes = 0.05 in 29
replace seats = 0 in 29

replace partyname = "Italy: LVR" in 30
replace votes = 0.05 in 30
replace seats = 0 in 30

replace partyname = "Italy: VDP" in 31
replace votes = 0.04 in 31
replace seats = 0 in 31

replace partyname = "Italy: VS" in 32
replace votes = 0.03 in 32
replace seats = 0 in 32

replace partyname = "Italy: RifI" in 33
replace votes = 0.02 in 33
replace seats = 0 in 33

replace partyname = "Italy: PRI" in 34
replace votes = 0.02 in 34
replace seats = 0 in 34

replace partyname = "Italy: Meris" in 35
replace votes = 0.02 in 35
replace seats = 0 in 35

replace partyname = "Italy: PDAC" in 36
replace votes = 0.02 in 36
replace seats = 0 in 36

replace partyname = "Italy: i Pirati" in 37
replace votes = 0.01 in 37
replace seats = 0 in 37

replace partyname = "Italy: MID" in 38
replace votes = 0.01 in 38
replace seats = 0 in 38

replace partyname = "Italy: MIS" in 39
replace votes = 0.01 in 39
replace seats = 0 in 39

replace partyname = "Italy: PU" in 40
replace votes = 0.01 in 40
replace seats = 0 in 40

replace partyname = "Italy: PN" in 41
replace votes = 0.01 in 41
replace seats = 0 in 41

replace partyname = "Italy: PPA" in 42
replace votes = 0 in 42
replace seats = 0 in 42

replace partyname = "Italy: UP" in 43
replace votes = 0 in 43
replace seats = 0 in 43

replace partyname = "Italy: TIPI" in 44
replace votes = 0 in 44
replace seats = 0 in 44

replace partyname = "Italy: SI" in 45
replace votes = 0 in 45
replace seats = 0 in 45

replace partyname = "Italy: DA" in 46
replace votes = 0 in 46
replace seats = 0 in 46

replace partyname = "Italy: IPLS" in 47
replace votes = 0.02 in 47
replace seats = 0 in 47


*Italy 2018. Source: Ministry for Internal Affairs: https://elezionistorico.interno.gov.it/index.php?tpel=C&dtel=04/03/2018&tpa=I&tpe=A&lev0=0&levsut0=0&es0=S&ms=S
**Electoral reform Rosatellum bis 2017 main difficulties (Source Senate document: http://www.senato.it/service/PDF/PDFServer/BGT/01047609.pdf) 
**(1) threshold of 3% for single running parties, 10% for coalitions but 1% within the coalition if at least one party of the coalition reaches 3%
**(2) mix system with 37% seats (232/630) reserved to the first-past-the-post attribution and rest is proportional, but coalitions count as 1 in this case, while parties within coalitions are attributed seats individually in the proportional system

insobs 33, before(1)

replace country = 15 in 1/33
replace countryname = "Italy" in 1/33
replace year = 2018 in 1/33
replace edate = "04Mar2018" in 1/33
replace eleccount = 7 in 1/33
replace threshold = 3 in 1/33

replace partyname = "Italy: LN" in 1
replace votes = 17.35 in 1
replace seats = 73 in 1

replace partyname = "Italy: FDI" in 3
replace votes = 4.35 in 3
replace seats = 19 in 3

replace partyname = "Italy: UDC" in 4
replace votes = 1.3 in 4
replace seats = 0 in 4

replace partyname = "Italy: M5S" in 5
replace votes = 32.68 in 5
replace seats = 133 in 5

replace partyname = "Italy: PD" in 6
replace votes = 18.76 in 6
replace seats = 86 in 6

replace partyname = "Italy: Europa" in 7
replace votes = 2.56 in 7
replace seats = 0 in 7

replace partyname = "Italy: IEI" in 8
replace votes = 0.58 in 8
replace seats = 0 in 8

replace partyname = "Italy: CP" in 9
replace votes = 0.54 in 9
replace seats = 0 in 9

replace partyname = "Italy: SVP/PATT" in 10
replace votes = 0.41 in 10
replace seats = 2 in 10

replace partyname = "Italy: LU" in 11
replace votes = 3.39 in 11
replace seats = 14 in 11

replace partyname = "Italy: PAP" in 12
replace votes = 1.13 in 12
replace seats = 0 in 12

replace partyname = "Italy: CI" in 13
replace votes = 0.95 in 13
replace seats = 0 in 13

replace partyname = "Italy: PDF" in 14
replace votes = 0.67 in 14
replace seats = 0 in 14

replace partyname = "Italy: FN/FT" in 15
replace votes = 0.39 in 15
replace seats = 0 in 15

replace partyname = "Italy: PC" in 16
replace votes = 0.33 in 16
replace seats = 0 in 16

replace partyname = "Italy: PVU" in 17
replace votes = 0.15 in 17
replace seats = 0 in 17

replace partyname = "Italy: 10VM" in 18
replace votes = 0.11 in 18
replace seats = 0 in 18

replace partyname = "Italy: PSR" in 19
replace votes = 0.09 in 19
replace seats = 0 in 19

replace partyname = "Italy: PRI/ALA" in 20
replace votes = 0.06 in 20
replace seats = 0 in 20

replace partyname = "Italy: GN" in 21
replace votes = 0.06 in 21
replace seats = 0 in 21

replace partyname = "Italy: Auto" in 22
replace votes = 0.06 in 22
replace seats = 0 in 22

replace partyname = "Italy: LPPLC" in 23
replace votes = 0.03 in 23
replace seats = 0 in 23

replace partyname = "Italy: PPLA" in 24
replace votes = 0.02 in 24
replace seats = 0 in 24

replace partyname = "Italy: BNPL" in 25
replace votes = 0.01 in 25
replace seats = 0 in 25

replace partyname = "Italy: SIAMO" in 26
replace votes = 0 in 26
replace seats = 0 in 26

replace partyname = "Italy: MIR/R" in 27
replace votes = 0 in 27
replace seats = 0 in 27

replace partyname = "Italy: INC" in 28
replace votes = 0 in 28
replace seats = 0 in 28

*external constituency parties
replace partyname = "Italy: Movimento Associativo Italiani all'Estero" in 29
replace votes = 9.55 in 29
replace seats = 0 in 28

replace partyname = "Italy: USEI" in 30
replace votes = 6.08 in 30
replace seats = 1 in 30

replace partyname = "Italy: UNITAL" in 31
replace votes = 2.27 in 31
replace seats = 0 in 31

replace partyname = "Italy: MDL" in 32
replace votes = 0.94 in 32
replace seats = 0 in 32

replace partyname = "Italy: FFI" in 33
replace votes = 0.08 in 33
replace seats = 0 in 33

** LATVIA **
* Latvia 2014. Source: Central Election Commission http://sv2014.cvk.lv/index_rez.html?lang=1 / OSCE report for english translation : https://www.osce.org/odihr/elections/latvia/132416?download=true
insobs 13, before(1)

replace country = 16 in 1/13
replace countryname = "Latvia" in 1/13
replace year = 2014 in 1/13
replace edate = "04oct2014" in 1/13
replace eleccount = 8 in 1/13
replace threshold = 5 in 1/13

replace partyname = "Latvia: For the development of Latvia" in 1
replace votes = 0.89 in 1
replace seats = 0 in 1

replace partyname = "Latvia: Sovereignty" in 2
replace votes = 0.11 in 2
replace seats = 0 in 2

replace partyname = "Latvia: Freedom" in 3
replace votes = 0.19 in 3
replace seats = 0 in 3

replace partyname = "Latvia: V" in 4
replace votes = 21.87 in 4
replace seats = 23 in 4

replace partyname = "Latvia: Political Party Growth" in 5
replace votes = 0.17 in 5
replace seats = 0 in 5

replace partyname = "Latvia: United for Latvia" in 6
replace votes = 1.18 in 6
replace seats = 0 in 6

replace partyname = "Latvia: NA" in 7
replace votes = 16.61 in 7
replace seats = 17 in 7

replace partyname = "Latvia: Latvian Association of Regions" in 8
replace votes = 6.66 in 8
replace seats = 8 in 8

replace partyname = "Latvia: New Conservative Party" in 9
replace votes = 0.7 in 9
replace seats = 0 in 9

*This party has changed its name, and is now LKS "Latvian Russian Union"
replace partyname = "Latvia: PCTVL" in 10
replace votes = 1.58 in 10
replace seats = 0 in 10

replace partyname = "Latvia: SC" in 11
replace votes = 23 in 11
replace seats = 24 in 11

replace partyname = "Latvia: ZZS" in 12
replace votes = 19.53 in 12
replace seats = 21 in 12

replace partyname = "Latvia: From Heart to Latvia" in 13
replace votes = 6.85 in 13
replace seats = 7 in 13

*Latvia 2018. Source: Central Election Commission https://sv2018.cvk.lv/pub/ElectionResults / OSCE report for Engish translation : https://www.osce.org/odihr/elections/latvia/409344?download=true

insobs 16, before(1)

replace country = 16 in 1/16
replace countryname = "Latvia" in 1/16
replace year = 2018 in 1/16
replace edate = "06oct2018" in 1/16
replace eleccount = 9 in 1/16
replace threshold = 5 in 1/16

*this party has changed its name to LKS since 2014
replace partyname = "Latvia: PCTVL" in 1
replace votes = 3.20 in 1
replace seats = 0 in 1

replace partyname = "Latvia: New Conservative Party" in 2
replace votes = 13.59 in 2
replace seats = 7 in 2

replace partyname = "Latvia: Eiroskeptiki" in 3
replace votes = 0.12 in 3
replace seats = 0 in 3

replace partyname = "Latvia: NA" in 4
replace votes = 11.01 in 4
replace seats = 13 in 4

replace partyname = "Latvia: Latvian Centrist Party" in 5
replace votes = 0.1 in 5
replace seats = 0 in 5

replace partyname = "Latvia: Progressives" in 6
replace votes = 2.61 in 6
replace seats = 0 in 6

replace partyname = "Latvia: LSDSP/KDS/GKL" in 7
replace votes = 0.20 in 7
replace seats = 0 in 7

replace partyname = "Latvia: From Heart to Latvia" in 8
replace votes = 0.84 in 8
replace seats = 0 in 8

replace partyname = "Latvia: SC" in 9
replace votes = 19.8 in 9
replace seats = 23 in 9

replace partyname = "Latvia: For the development of Latvia" in 10
replace votes = 12.04 in 10
replace seats = 13 in 10

replace partyname = "Latvia: Latvian Association of Regions" in 11
replace votes = 4.14 in 11
replace seats = 0 in 11

replace partyname = "Latvia: Latvian Nationalists" in 12
replace votes = 0.5 in 12
replace seats = 0 in 12

replace partyname = "Latvia: V" in 13
replace votes = 6.69 in 13
replace seats = 8 in 13

replace partyname = "Latvia: For an Alternative" in 14
replace votes = 0.34 in 14
replace seats = 0 in 14

replace partyname = "Latvia: KPV/LV" in 15
replace votes = 14.25 in 15
replace seats = 16 in 15

replace partyname = "Latvia: ZZS" in 16
replace votes = 9.91 in 16
replace seats = 11 in 16

**LITHUANIA**
*Lithuania 2012. Source: OSCE Report: https://www.osce.org/odihr/98586?download=true - Fondation Robert Schuman for initials : https://www.robert-schuman.eu/en/doc/oee/oee-1663-en.pdf

insobs 18, before(1)

replace country = 17 in 1/18
replace countryname = "Lithuania" in 1/18
replace year = 2012 in 1/18
replace edate = "14oct2012" in 1/18
replace eleccount = 6 in 1/18
replace threshold = 5 in 1/18

replace partyname = "Lithuania: LSDP" in 1
replace votes = 18.37 in 1
replace seats = 38 in 1

replace partyname = "Lithuania: TS" in 2
replace votes = 15.08 in 2
replace seats = 33 in 2

replace partyname = "Lithuania: DP" in 3
replace votes = 19.82 in 3
replace seats = 29 in 3

*LDP is now called TT "Order and Justice*
replace partyname = "Lithuania: LDP" in 4
replace votes = 7.31 in 4
replace seats = 11 in 4

replace partyname = "Lithuania: LRLS" in 5
replace votes = 8.57 in 5
replace seats = 10 in 5

replace partyname = "Lithuania: AWPL" in 6
replace votes = 5.83 in 6
replace seats = 8 in 6

replace partyname = "Lithuania: DK" in 7
replace votes = 7.99 in 7
replace seats = 7 in 7

* VNDS is now called LVSZ "Farmers and Green's party"
replace partyname = "Lithuania: VNDS" in 8
replace votes = 3.88 in 8
replace seats = 1 in 8

replace partyname = "Lithuania: LiCS" in 9
replace votes = 2.06 in 9
replace seats = 0 in 9

replace partyname = "Lithuania: STAIP" in 10
replace votes = 1.76 in 10
replace seats = 0 in 10

replace partyname = "Lithuania: SLF" in 11
replace votes = 1.21 in 11
replace seats = 0 in 11

replace partyname = "Lithuania: KP" in 12
replace votes = 1.2 in 12
replace seats = 0 in 12

replace partyname = "Lithuania: ULL" in 13
replace votes = 0.94 in 13
replace seats = 0 in 13

replace partyname = "Lithuania: JL" in 14
replace votes = 0.63 in 14
replace seats = 0 in 14

replace partyname = "Lithuania: DDVP" in 15
replace votes = 0.32 in 15
replace seats = 0 in 15

replace partyname = "Lithuania: EP" in 16
replace votes = 0.29 in 16
replace seats = 0 in 16

replace partyname = "Lithuania: RP" in 17
replace votes = 0.27 in 17
replace seats = 0 in 17

replace partyname = "Lithuania: Lith. People's Party" in 18
replace votes = 0.25 in 18
replace seats = 0 in 18

*Lithuania 2016. Source: OSCE Report https://www.osce.org/odihr/elections/lithuania/296446?download=true

insobs 14, before(1)

replace country = 17 in 1/14
replace countryname = "Lithuania" in 1/14
replace year = 2016 in 1/14
replace edate = "09oct2016" in 1/14
replace eleccount = 7 in 1/14
replace threshold = 5 in 1/14

replace partyname = "Lithuania: TS" in 1
replace votes = 21.7 in 1
replace seats = 31 in 1

replace partyname = "Lithuania: VNDS" in 2
replace votes = 21.5 in 2
replace seats = 54 in 2

replace partyname = "Lithuania: LSDP" in 3
replace votes = 14.4 in 3
replace seats = 17 in 3

replace partyname = "Lithuania: LRLS" in 4
replace votes = 9.1 in 4
replace seats = 14 in 4

replace partyname = "Lithuania: K.LCP/LPP" in 5
replace votes = 6.1 in 5
replace seats = 0 in 5

replace partyname = "Lithuania: AWPL" in 6
replace votes = 5.5 in 6
replace seats = 8 in 6

replace partyname = "Lithuania: LDP" in 7
replace votes = 5.3 in 7
replace seats = 8 in 7

replace partyname = "Lithuania: DP" in 8
replace votes = 4.7 in 8
replace seats = 2 in 8

replace partyname = "Lithuania: LLSL" in 9
replace votes = 2.1 in 9
replace seats = 0 in 9

replace partyname = "Lithuania: Green Party" in 10
replace votes = 1.9 in 10
replace seats = 1 in 10

replace partyname = "Lithuania: PPLS" in 11
replace votes = 1.7 in 11
replace seats = 1 in 11

replace partyname = "Lithuania: LLP" in 12
replace votes = 1 in 12
replace seats = 0 in 12

replace partyname = "Lithuania: K.TS/PJL" in 13
replace votes = 0.5 in 13
replace seats = 0 in 13

replace partyname = "Lithuania: DK" in 14
replace votes = 0.3 in 14
replace seats = 0 in 14

**MACEDONIA**
*Macedonia 2011. Source: OSCE Report: https://www.osce.org/odihr/elections/FYROM/83666?download=true

insobs 18, before(1)

replace country = 18 in 1/18
replace countryname = "Macedonia" in 1/18
replace year = 2011 in 1/18
replace edate = "05jun2011" in 1/18
replace eleccount = 5 in 1/18
replace threshold = . in 1/18

replace partyname = "Macedonia: ND" in 1
replace votes = 1.78 in 1
replace seats = 0 in 1

replace partyname = "Macedonia: PODEM" in 2
replace votes = 0.39 in 2
replace seats = 0 in 2

replace partyname = "Macedonia: SDU" in 3
replace votes = 0.2 in 3
replace seats = 0 in 3

replace partyname = "Macedonia: Albanian Democratic Union" in 4
replace votes = 0.4 in 4
replace seats = 0 in 4

replace partyname = "Macedonia: VMRODPMNE" in 5
replace votes = 38.98 in 5
replace seats = 56 in 5

replace partyname = "Macedonia: VMRO/NP" in 6
replace votes = 2.51 in 6
replace seats = 0 in 6

replace partyname = "Macedonia: BDI" in 7
replace votes = 10.24 in 7
replace seats = 15 in 7

replace partyname = "Macedonia: PDSH" in 8
replace votes = 5.9 in 8
replace seats = 8 in 8

replace partyname = "Macedonia: Dostoinstvo" in 9
replace votes = 0.79 in 9
replace seats = 0 in 9

replace partyname = "Macedonia: SDSM" in 10
replace votes = 32.78 in 10
replace seats = 42 in 10

replace partyname = "Macedonia: National Democratic Union" in 11
replace votes = 0.04 in 11
replace seats = 0 in 11

replace partyname = "Macedonia: LDU" in 12
replace votes = 1.47 in 12
replace seats = 0 in 12

replace partyname = "Macedonia: Social Democratic Party" in 13
replace votes = 0.16 in 13
replace seats = 0 in 13

replace partyname = "Macedonia: Democratic Right" in 14
replace votes = 0.13 in 14
replace seats = 0 in 14

replace partyname = "Macedonia: European Party of Macedonia" in 15
replace votes = 0.01 in 15
replace seats = 0 in 15

replace partyname = "Macedonia: PPD" in 16
replace votes = 0.02 in 16
replace seats = 0 in 16

replace partyname = "Macedonia: NDR" in 17
replace votes = 2.67 in 17
replace seats = 2 in 17

replace partyname = "Macedonia: OM" in 18
replace votes = 1.52 in 18
replace seats = 0 in 18

** No further coding of Macedonia since it does not have electoral threshold anymore

** GREECE **
* May 2012. Source: Ministry of Interior: http://ekloges-prev.singularlogic.eu/v2012a/public/index.html?lang=en#{%22cls%22:%22level%22,%22params%22:{%22level%22:%22epik%22,%22id%22:1}}

insobs 32, before(1)

replace country = 11 in 1/32
replace countryname = "Greece" in 1/32
replace year = 2012.1 in 1/32
replace edate = "06may2012" in 1/32
replace eleccount = 7 in 1/32
replace threshold = 3 in 1/32

replace partyname = "Greece: ND" in 1
replace votes = 18.85 in 1
replace seats = 108 in 1

replace partyname = "Greece: SYRIZA" in 2
replace votes = 16.59 in 2
replace seats = 52 in 2

replace partyname = "Greece: PASOK" in 3
replace votes = 13.18 in 3
replace seats = 41 in 3

replace partyname = "Greece: ANEL" in 4
replace votes = 10.62 in 4
replace seats = 33 in 4

replace partyname = "Greece: KKE" in 4
replace votes = 8.48 in 4
replace seats = 26 in 4

replace partyname = "Greece: XA" in 6
replace votes = 6.97 in 6
replace seats = 21 in 6

replace partyname = "Greece: DIMAR" in 7
replace votes = 6.97 in 7
replace seats = 19 in 7

replace partyname = "Greece: OP" in 8
replace votes = 2.93 in 8
replace seats = 0 in 8

replace partyname = "Greece: LAOS" in 9
replace votes = 2.89 in 9
replace seats = 0 in 9

replace partyname = "Greece: DISY" in 10
replace votes = 2.55 in 10
replace seats = 0 in 10

replace partyname = "Greece: DIXA" in 11
replace votes = 2.15 in 11
replace seats = 0 in 11

replace partyname = "Greece: DRASI-FS" in 12
replace votes = 1.8 in 12
replace seats = 0 in 12

replace partyname = "Greece: ANTARSYA" in 13
replace votes = 1.19 in 13
replace seats = 0 in 13

replace partyname = "Greece: KOISY" in 14
replace votes = 0.96 in 14
replace seats = 0 in 14

replace partyname = "Greece: OCHI (DA-EPAM)" in 15
replace votes = 0.92 in 15
replace seats = 0 in 15

replace partyname = "Greece: KP" in 16
replace votes = 0.88 in 16
replace seats = 0 in 16

replace partyname = "Greece: EK" in 17
replace votes = 0.61 in 17
replace seats = 0 in 17

replace partyname = "Greece: SEE" in 18
replace votes = 0.61 in 18
replace seats = 0 in 18

replace partyname = "Greece: KPE" in 19
replace votes = 0.51 in 19
replace seats = 0 in 19

replace partyname = "Greece: Koinonia" in 20
replace votes = 0.45 in 20
replace seats = 0 in 20

replace partyname = "Greece: Koinonia" in 21
replace votes = 0.45 in 21
replace seats = 0 in 21

replace partyname = "Greece: M-L KKE" in 22
replace votes = 0.25 in 22
replace seats = 0 in 22

replace partyname = "Greece: EEK" in 23
replace votes = 0.10 in 23
replace seats = 0 in 23

replace partyname = "Greece: KF" in 24
replace votes = 0.06 in 24
replace seats = 0 in 24

replace partyname = "Greece: OAKKE" in 25
replace votes = 0.04 in 25
replace seats = 0 in 25

replace partyname = "Greece: OKDE" in 26
replace votes = 0.03 in 26
replace seats = 0 in 26

replace partyname = "Greece: Dignity" in 27
replace votes = 0.01 in 27
replace seats = 0 in 27

replace partyname = "Greece: KEAN" in 28
replace votes = 0.00 in 28
replace seats = 0 in 28

replace partyname = "Greece: PAEKE" in 29
replace votes = 0.00 in 29
replace seats = 0 in 29

replace partyname = "Greece: PANKI" in 30
replace votes = 0.00 in 30
replace seats = 0 in 30

replace partyname = "Greece: EI" in 31
replace votes = 0.00 in 31
replace seats = 0 in 31

replace partyname = "Greece: PAA" in 32
replace votes = 0.00 in 32
replace seats = 0 in 32

* June 2012. Source: Ministry of Interior: http://ekloges-prev.singularlogic.eu/v2012b/public/index.html?lang=en#{%22cls%22:%22level%22,%22params%22:{%22level%22:%22epik%22,%22id%22:1}}

insobs 21, before(1)

replace country = 11 in 1/21
replace countryname = "Greece" in 1/21
replace year = 2012.2 in 1/21
replace edate = "17jun2012" in 1/21
replace eleccount = 8 in 1/21
replace threshold = 3 in 1/21

replace partyname = "Greece: ND" in 1
replace votes = 29.66 in 1
replace seats = 129 in 1

replace partyname = "Greece: SYRIZA" in 2
replace votes = 26.89 in 2
replace seats = 71 in 2

replace partyname = "Greece: PASOK" in 3
replace votes = 12.28 in 3
replace seats = 33 in 3

replace partyname = "Greece: ANEL" in 4
replace votes = 7.51 in 4
replace seats = 20 in 4

replace partyname = "Greece: XA" in 5
replace votes = 6.92 in 5
replace seats = 18 in 5

replace partyname = "Greece: DIMAR" in 6
replace votes = 6.25 in 6
replace seats = 17 in 6

replace partyname = "Greece: KKE" in 7
replace votes = 4.5 in 7
replace seats = 17 in 7

replace partyname = "Greece: DIXA-DRASO-FS" in 8
replace votes = 1.59 in 8
replace seats = 0 in 8

replace partyname = "Greece: LAOS" in 9
replace votes = 1.58 in 9
replace seats = 0 in 9

replace partyname = "Greece: OP" in 10
replace votes = 0.88 in 10
replace seats = 0 in 10

replace partyname = "Greece: KP" in 11
replace votes = 0.39 in 11
replace seats = 0 in 11

replace partyname = "Greece: ANTARSYA" in 12
replace votes = 0.33 in 12
replace seats = 0 in 12

replace partyname = "Greece: Koinonia" in 13
replace votes = 0.29 in 13
replace seats = 0 in 13

replace partyname = "Greece: EK" in 14
replace votes = 0.28 in 14
replace seats = 0 in 14

replace partyname = "Greece: KPE" in 15
replace votes = 0.23 in 15
replace seats = 0 in 15

replace partyname = "Greece: PANKI" in 16
replace votes = 0.20 in 16
replace seats = 0 in 16

replace partyname = "Greece: M-L KKE" in 17
replace votes = 0.12 in 17
replace seats = 0 in 17

replace partyname = "Greece: EE" in 18
replace votes = 0.07 in 18
replace seats = 0 in 18

replace partyname = "Greece: KF" in 19
replace votes = 0.01 in 19
replace seats = 0 in 19

replace partyname = "Greece: KEAN" in 20
replace votes = 0.00 in 20
replace seats = 0 in 20

replace partyname = "Greece: PAEKE" in 21
replace votes = 0.00 in 21
replace seats = 0 in 21

* January 2015. Source: Ministry of Interior: http://ekloges-prev.singularlogic.eu/v2015a/v/public/index.html?lang=en#{%22cls%22:%22level%22,%22params%22:{%22level%22:%22epik%22,%22id%22:1}}

insobs 22, before(1)

replace country = 11 in 1/22
replace countryname = "Greece" in 1/22
replace year = 2015.1 in 1/22
replace edate = "25jan2015" in 1/22
replace eleccount = 9 in 1/22
replace threshold = 3 in 1/22

replace partyname = "Greece: SYRIZA" in 1
replace votes = 36.34 in 1
replace seats = 149 in 1

replace partyname = "Greece: ND" in 2
replace votes = 27.81 in 2
replace seats = 76 in 2

replace partyname = "Greece: XA" in 3
replace votes = 6.28 in 3
replace seats = 17 in 3

replace partyname = "Greece: To Potami" in 4
replace votes = 6.05 in 4
replace seats = 17 in 4

replace partyname = "Greece: KKE" in 5
replace votes = 5.47 in 5
replace seats = 15 in 5

replace partyname = "Greece: ANEL" in 6
replace votes = 4.75 in 6
replace seats = 13 in 6

replace partyname = "Greece: PASOK-DP" in 7
replace votes = 4.68 in 7
replace seats = 13 in 7

replace partyname = "Greece: KIDISO" in 8
replace votes = 2.47 in 8
replace seats = 0 in 8

replace partyname = "Greece: EK" in 9
replace votes = 1.79 in 9
replace seats = 0 in 9

replace partyname = "Greece: Teleia" in 10
replace votes = 1.77 in 10
replace seats = 0 in 10

replace partyname = "Greece: LAOS" in 11
replace votes = 1.03 in 11
replace seats = 0 in 11

replace partyname = "Greece: MARS" in 12
replace votes = 0.64 in 12
replace seats = 0 in 12

replace partyname = "Greece: DIMAR" in 13
replace votes = 0.48 in 13
replace seats = 0 in 13

replace partyname = "Greece: M-L KKE" in 14
replace votes = 0.13 in 14
replace seats = 0 in 14

replace partyname = "Greece: EDEM" in 15
replace votes = 0.12 in 15
replace seats = 0 in 15

replace partyname = "Greece: ELLADA" in 16
replace votes = 0.08 in 16
replace seats = 0 in 16

replace partyname = "Greece: EEK" in 17
replace votes = 0.04 in 17
replace seats = 0 in 17

replace partyname = "Greece: OKDE" in 18
replace votes = 0.03 in 18
replace seats = 0 in 18

replace partyname = "Greece: KEAN" in 19
replace votes = 0.01 in 19
replace seats = 0 in 19

replace partyname = "Greece: ELKSI" in 20
replace votes = 0.00 in 20
replace seats = 0 in 20

replace partyname = "Greece: ROMA" in 21
replace votes = 0.00 in 21
replace seats = 0 in 21

replace partyname = "Greece: PAEKE" in 22
replace votes = 0.00 in 22
replace seats = 0 in 22

* September 2015. Source: Ministry of Interior: http://ekloges-prev.singularlogic.eu/v2015a/v/public/index.html?lang=en#{%22cls%22:%22level%22,%22params%22:{%22level%22:%22epik%22,%22id%22:1}}

insobs 19, before(1)

replace country = 11 in 1/19
replace countryname = "Greece" in 1/19
replace year = 2015.2 in 1/19
replace edate = "20sep2015" in 1/19
replace eleccount = 10 in 1/19
replace threshold = 3 in 1/19

replace partyname = "Greece: SYRIZA" in 1
replace votes = 35.46 in 1
replace seats = 145 in 1

replace partyname = "Greece: ND" in 2
replace votes = 28.09 in 2
replace seats = 75 in 2

replace partyname = "Greece: XA" in 3
replace votes = 6.99 in 3
replace seats = 18 in 3

replace partyname = "Greece: PASOK-DIMAR" in 4
replace votes = 6.29 in 4
replace seats = 17 in 4

replace partyname = "Greece: KKE" in 5
replace votes = 5.55 in 5
replace seats = 15 in 5

replace partyname = "Greece: To Potami" in 6
replace votes = 4.09 in 6
replace seats = 15 in 6

replace partyname = "Greece: ANEL" in 7
replace votes = 3.69 in 7
replace seats = 10 in 7

replace partyname = "Greece: EK" in 8
replace votes = 3.69 in 8
replace seats = 9 in 8

replace partyname = "Greece: LAE" in 9
replace votes = 2.89 in 9
replace seats = 0 in 9

replace partyname = "Greece: ANTARSYA-EEK" in 10
replace votes = 0.85 in 10
replace seats = 0 in 10

replace partyname = "Greece: EPAM" in 11
replace votes = 0.77 in 11
replace seats = 0 in 11

replace partyname = "Greece: Koinonia" in 12
replace votes = 0.65 in 12
replace seats = 0 in 12

replace partyname = "Greece: DX" in 13
replace votes = 0.53 in 13
replace seats = 0 in 13

replace partyname = "Greece: D-KA-KPE" in 14
replace votes = 0.28 in 14
replace seats = 0 in 14

replace partyname = "Greece: M-L KKE" in 15
replace votes = 0.16 in 15
replace seats = 0 in 15

replace partyname = "Greece: ELAS" in 16
replace votes = 0.11 in 16
replace seats = 0 in 16

replace partyname = "Greece: ELLADA" in 17
replace votes = 0.08 in 17
replace seats = 0 in 17

replace partyname = "Greece: OKDE" in 18
replace votes = 0.04 in 18
replace seats = 0 in 18

replace partyname = "Greece: OAKKE" in 19
replace votes = 0.04 in 19
replace seats = 0 in 19

** CYPRUS
* 2016. Source: Ministry of Interior: http://results.elections.moi.gov.cy/English/PARLIAMENTARY_ELECTIONS_2016/Islandwide

insobs 12, before(1)

replace country = 5 in 1/12
replace countryname = "Cyprus" in 1/12
replace year = 2016 in 1/12
replace edate = "22may2016" in 1/12
replace eleccount = 5 in 1/12
replace threshold = 1.785714 in 1/12

replace partyname = "Cyprus: DISY" in 1
replace votes = 30.64 in 1
replace seats = 18 in 1

replace partyname = "Cyprus: AKEL" in 2
replace votes = 25.67 in 2
replace seats = 16 in 2

replace partyname = "Cyprus: DIKO" in 3
replace votes = 14.49 in 3
replace seats = 9 in 3

replace partyname = "Cyprus: EDEK" in 4
replace votes = 6.18 in 4
replace seats = 3 in 4

replace partyname = "Cyprus: SYPOL" in 5
replace votes = 6.01 in 5
replace seats = 3 in 5

replace partyname = "Cyprus: KA" in 6
replace votes = 5.24 in 6
replace seats = 3 in 6

replace partyname = "Cyprus: KOSP" in 7
replace votes = 4.81 in 7
replace seats = 2 in 7

replace partyname = "Cyprus: ELAM" in 8
replace votes = 3.71 in 8
replace seats = 2 in 8

replace partyname = "Cyprus: APC" in 9
replace votes = 1.16 in 9
replace seats = 0 in 9

replace partyname = "Cyprus: PL" in 10
replace votes = 0.87 in 10
replace seats = 0 in 10

replace partyname = "Cyprus: KKS" in 11
replace votes = 0.58 in 11
replace seats = 0 in 11

replace partyname = "Cyprus: OAD" in 12
replace votes = 0.28 in 12
replace seats = 0 in 12


** CROATIA
* 2016

insobs 28, before(1)

replace countryname = "Croatia" in 1/28
replace year = 2016 in 1/28
replace edate = "11sep2016" in 1/28
replace threshold = 5 in 1/28

replace partyname = "Croatia: HDZ Coalition" in 1
replace votes = 36.58 in 1
replace seats = 61 in 1

replace partyname = "Croatia: People's Coalition" in 2
replace votes = 33.45 in 2
replace seats = 54 in 2

replace partyname = "Croatia: Bridge of Independent Lists" in 3
replace votes = 9.84 in 3
replace seats = 13 in 3

replace partyname = "Croatia: The Only Option Coalition" in 4
replace votes = 6.17 in 4
replace seats = 8 in 4

replace partyname = "Croatia: For Prime Minister Coalition" in 5
replace votes = 4.05 in 5
replace seats = 2 in 5

replace partyname = "Croatia: Even Stronger Istria Coalition" in 6
replace votes = 2.27 in 6
replace seats = 3 in 6

replace partyname = "Croatia: Turn Croatia Around Coalition" in 7
replace votes = 2.05 in 7
replace seats = 0 in 7

replace partyname = "Croatia: HDSSB Coalition" in 8
replace votes = 1.24 in 8
replace seats = 1 in 8

replace partyname = "Croatia: Move Coalition" in 9
replace votes = 0.69 in 9
replace seats = 0 in 9

replace partyname = "Croatia: Homeland Coalition" in 10
replace votes = 0.59 in 10
replace seats = 0 in 10

replace partyname = "Croatia: Labour Party" in 11
replace votes = 0.25 in 11
replace seats = 0 in 11

replace partyname = "NLSP–SH–PZ–ORaH–SHZ–SU–ZS" in 12
replace votes = 1.18 in 12
replace seats = 0 in 12

replace partyname = "Socialist Labour Party of Croatia" in 13
replace votes = 0.19 in 13
replace seats = 0 in 13

replace partyname = "Let's Unblock Croatia" in 14
replace votes = 0.16 in 14
replace seats = 0 in 14

replace partyname = "Women's Democratic Party" in 15
replace votes = 0.11 in 15
replace seats = 0 in 15

replace partyname = "Istrian Democrats" in 16
replace votes = 0.09 in 16
replace seats = 0 in 16

replace partyname = "Very Small Party" in 17
replace votes = 0.07 in 17
replace seats = 0 in 17

replace partyname = "Croatia Defence People's Party" in 18
replace votes = 0.06 in 18
replace seats = 0 in 18

replace partyname = "Veterans' Patriotic Party of Croatia" in 19
replace votes = 0.06 in 19
replace seats = 0 in 19

replace partyname = "Green Party" in 20
replace votes = 0.06 in 20
replace seats = 0 in 20

replace partyname = "Croatian Party of Rights 1861" in 21
replace votes = 0.05 in 21
replace seats = 0 in 21

replace partyname = "Croatian Republican Party" in 22
replace votes = 0.04 in 22
replace seats = 0 in 22

replace partyname = "Međimurje Democratic Alliance" in 23
replace votes = 0.04 in 23
replace seats = 0 in 23

replace partyname = "Croatian Party of Order" in 24
replace votes = 0.03 in 24
replace seats = 0 in 24

replace partyname = "Active Veterans and Pensioners of Croatia" in 25
replace votes = 0.02 in 25
replace seats = 0 in 25

replace partyname = "Croatian Aspect Party" in 26
replace votes = 0.02 in 26
replace seats = 0 in 26

replace partyname = "Party of Development and Progress" in 27
replace votes = 0.02 in 27
replace seats = 0 in 27

replace partyname = "Movement for Modern Croatia" in 28
replace votes = 0.02 in 28
replace seats = 0 in 28


* 2015

insobs 24, before(1)

replace countryname = "Croatia" in 1/24
replace year = 2015 in 1/24
replace edate = "08nov2015" in 1/24
replace threshold = 5 in 1/24

replace partyname = "Croatia: Patriotic Coalition" in 1
replace votes = 34.64 in 1
replace seats = 59 in 1

replace partyname = "Croatia: Croatia is Growing" in 2
replace votes = 33.38 in 2
replace seats = 56 in 2

replace partyname = "Croatia: Bridge of Independent Lists" in 3
replace votes = 13.64 in 3
replace seats = 19 in 3

replace partyname = "Croatia: The Right to Our Own" in 4
replace votes = 1.9 in 4
replace seats = 3 in 4

replace partyname = "Croatia: Labour and Solidarity Coalition" in 5
replace votes = 3.39 in 5
replace seats = 2 in 5

replace partyname = "Croatia: Croatian Democratic Alliance of Slavonia and Baranja " in 6
replace votes = 1.37 in 6
replace seats = 2 in 6

replace partyname = "Croatia: Human Blockade" in 7
replace votes = 4.54 in 7
replace seats = 1 in 7

replace partyname = "Croatia: Successful Croatia" in 8
replace votes = 1.57 in 8
replace seats = 1 in 8

replace partyname = "Croatia: Sustainable Development of Croatia" in 9
replace votes = 1.76 in 9
replace seats = 0 in 9

replace partyname = "Croatia: In the Name of the Family – Project Homeland" in 10
replace votes = 1.07 in 10
replace seats = 0 in 10

replace partyname = "HKS–HSP–OS" in 11
replace votes = 0.63 in 11
replace seats = 0 in 11

replace partyname = "Authentic Croatian Party of Rights" in 12
replace votes = 0.54 in 12
replace seats = 0 in 12

replace partyname = "Pametno" in 13
replace votes = 0.27 in 13
replace seats = 0 in 13

replace partyname = "Croatian Dawn – Party of the People" in 14
replace votes = 0.20 in 14
replace seats = 0 in 14

replace partyname = "HKDU–HDS–NDS" in 15
replace votes = 0.14 in 15
replace seats = 0 in 15

replace partyname = "Za Grad" in 16
replace votes = 0.11 in 16
replace seats = 0 in 16

replace partyname = "Socialist Labour Party of Croatia" in 17
replace votes = 0.11 in 17
replace seats = 0 in 17

replace partyname = "Croatian Civic Party" in 18
replace votes = 0.10 in 18
replace seats = 0 in 18

replace partyname = "Veterans' Patriotic Party of Croatia" in 19
replace votes = 0.07 in 19
replace seats = 0 in 19

replace partyname = "Democratic Alliance of National Reconstruction" in 20
replace votes = 0.07 in 20
replace seats = 0 in 20

replace partyname = "Workers' Front" in 21
replace votes = 0.06 in 21
replace seats = 0 in 21

replace partyname = "Together Movement" in 22
replace votes = 0.04 in 22
replace seats = 0 in 22

replace partyname = "Međimurje Democratic Alliance" in 23
replace votes = 0.03 in 23
replace seats = 0 in 23

replace partyname = "Croatian Party of Order" in 24
replace votes = 0.01 in 24
replace seats = 0 in 24

** MONTENEGRO
* 2012

insobs 13, before(1)

replace countryname = "Montenegro" in 1/13
replace year = 2012 in 1/13
replace edate = "14oct2012" in 1/13
replace threshold = 3 in 1/13

replace partyname = "Montenegro: ECG" in 1
replace votes = 45.6 in 1
replace seats = 39 in 1

replace partyname = "Montenegro: DF" in 2
replace votes = 22.82 in 2
replace seats = 20 in 2

replace partyname = "Montenegro: SNP" in 3
replace votes = 11.06 in 3
replace seats = 9 in 3

replace partyname = "Montenegro: PCG" in 4
replace votes = 8.24 in 4
replace seats = 7 in 4

replace partyname = "Montenegro: BS" in 5
replace votes = 4.17 in 5
replace seats = 3 in 5

replace partyname = "Montenegro: Serb Unity" in 6
replace votes = 1.45  in 6
replace seats = 0 in 6

replace partyname = "Montenegro: For Unity" in 7
replace votes = 1.45 in 7
replace seats = 0 in 7

replace partyname = "Montenegro: Albanian Coalition" in 8
replace votes = 1.05 in 8
replace seats = 1 in 8

replace partyname = "Montenegro: Serb National Alliance" in 9
replace votes = 0.85 in 9
replace seats = 0 in 9

replace partyname = "Montenegro: Democratic Union of Albanians" in 10
replace votes = 0.79 in 10
replace seats = 0 in 10

replace partyname = "Montenegro: Croatian Civic Initiative" in 11
replace votes = 0.40 in 11
replace seats = 1 in 11

replace partyname = "Montenegro: Together" in 12
replace votes = 0.38 in 12
replace seats = 0 in 12

replace partyname = "Montenegro: Albanian Youth Alliance" in 13
replace votes = 0.15 in 13
replace seats = 0 in 13

* 2016

insobs 17, before(1)

replace countryname = "Montenegro" in 1/17
replace year = 2016 in 1/17
replace edate = "16oct2016" in 1/17
replace threshold = 3 in 1/17

replace partyname = "Montenegro: Democratic Party of Socialists" in 1
replace votes = 41.41 in 1
replace seats = 36 in 1

replace partyname = "Montenegro: Democratic Front" in 2
replace votes = 20.32 in 2
replace seats = 18 in 2

replace partyname = "Montenegro: Key Coalition" in 3
replace votes = 11.05 in 3
replace seats = 9 in 3

replace partyname = "Montenegro: Democratic Montenegro" in 4
replace votes = 10.01 in 4
replace seats = 8 in 4

replace partyname = "Montenegro: Social Democratic Party" in 5
replace votes = 5.23 in 5
replace seats = 4 in 5

replace partyname = "Montenegro: Social Democrats" in 6
replace votes = 3.26  in 6
replace seats = 2 in 6

replace partyname = "Montenegro: Bosniak Party" in 7
replace votes = 3.16 in 7
replace seats = 2 in 7

replace partyname = "Montenegro: Positive Montenegro" in 8
replace votes = 1.32 in 8
replace seats = 0 in 8

replace partyname = "Montenegro: Albanians Decisively" in 9
replace votes = 1.27 in 9
replace seats = 1 in 9

replace partyname = "Montenegro: Albanian Coalition" in 10
replace votes = 0.89 in 10
replace seats = 0 in 10

replace partyname = "Montenegro: Croatian Civic Initiative" in 11
replace votes = 0.47 in 11
replace seats = 1 in 11

replace partyname = "Montenegro: Democratic Alliance of Albanians" in 12
replace votes = 0.40 in 12
replace seats = 0 in 12

replace partyname = "Montenegro: Serb Party" in 13
replace votes = 0.31 in 13
replace seats = 0 in 13

replace partyname = "Montenegro: Bosniak Democratic Community in Montenegro" in 14
replace votes = 0.30 in 14
replace seats = 0 in 14

replace partyname = "Montenegro: Alternative Montenegro" in 15
replace votes = 0.23 in 15
replace seats = 0 in 15

replace partyname = "Montenegro: Party of Serb Radicals" in 16
replace votes = 0.18 in 16
replace seats = 0 in 16

replace partyname = "Montenegro: Party of Pensioners, Disabled and Social Justice" in 17
replace votes = 0.18 in 17
replace seats = 0 in 17

** TURKEY
* June 2015

insobs 20, before(1)

replace countryname = "Turkey" in 1/20
replace year = 2015 in 1/20
replace edate = "07jun2015" in 1/20
replace threshold = 10 in 1/20

replace partyname = "Turkey: Justice and Development Party" in 1
replace votes = 40.87 in 1
replace seats = 258 in 1

replace partyname = "Turkey:  Republican People's Party" in 2
replace votes = 24.95 in 2
replace seats = 132 in 2

replace partyname = "Turkey: Nationalist Movement Party" in 3
replace votes = 16.29 in 3
replace seats = 80 in 3

replace partyname = "Turkey: Peoples' Democratic Party" in 4
replace votes = 13.12 in 4
replace seats = 80 in 4

replace partyname = "Turkey: Felicity Party" in 5
replace votes = 2.06 in 5
replace seats = 0 in 5

replace partyname = "Turkey: Patriotic Party " in 6
replace votes = 0.35 in 6
replace seats = 0 in 6

replace partyname = "Turkey: Independent Turkey Party" in 7
replace votes = 0.21 in 7
replace seats = 0 in 7

replace partyname = "Turkey: Democratic Left Party" in 8
replace votes = 0.19 in 8
replace seats = 0 in 8

replace partyname = "Turkey: Democrat Party" in 9
replace votes = 0.16 in 9
replace seats = 0 in 9

replace partyname = "Turkey: Social Reconciliation Reform and Development Party" in 10
replace votes = 0.16 in 10
replace seats = 0 in 10

replace partyname = "Turkey: People's Liberation Party" in 11
replace votes = 0.13 in 11
replace seats = 0 in 11

replace partyname = "Turkey: Rights and Freedoms Party" in 12
replace votes = 0.13 in 12
replace seats = 0 in 12

replace partyname = "Turkey: True Path Party" in 13
replace votes = 0.06 in 13
replace seats = 0 in 13

replace partyname = "Turkey: Anatolia Party" in 14
replace votes = 0.06 in 14
replace seats = 0 in 14

replace partyname = "Turkey: Liberal Democrat Party" in 15
replace votes = 0.06 in 15
replace seats = 0 in 15

replace partyname = "Turkey: Center Party" in 16
replace votes = 0.05 in 16
replace seats = 0 in 16

replace partyname = "Turkey: Nation Party" in 17
replace votes = 0.04 in 17
replace seats = 0 in 17

replace partyname = "Turkey: Communist Party" in 18
replace votes = 0.03 in 18
replace seats = 0 in 18

replace partyname = "Turkey: Homeland Party" in 19
replace votes = 0.02 in 19
replace seats = 0 in 19

replace partyname = "Turkey: Rights and Justice Party" in 20
replace votes = 0.01 in 20
replace seats = 0 in 20

* Nov 2015

insobs 16, before(1)

replace countryname = "Turkey" in 1/16
replace year = 2015 in 1/16
replace edate = "01nov2015" in 1/16
replace threshold = 10 in 1/16

replace partyname = "Turkey: Justice and Development Party" in 1
replace votes = 49.5 in 1
replace seats = 317 in 1

replace partyname = "Turkey:  Republican People's Party" in 2
replace votes = 25.32 in 2
replace seats = 134 in 2

replace partyname = "Turkey: Nationalist Movement Party" in 3
replace votes = 11.9 in 3
replace seats = 40 in 3

replace partyname = "Turkey: Peoples' Democratic Party" in 4
replace votes = 10.76 in 4
replace seats = 59 in 4

replace partyname = "Turkey: Felicity Party" in 5
replace votes = 0.68 in 5
replace seats = 0 in 5

replace partyname = "Turkey: Great Union Party" in 6
replace votes = 0.53 in 6
replace seats = 0 in 6

replace partyname = "Turkey: Patriotic Party " in 7
replace votes = 0.25 in 7
replace seats = 0 in 7

replace partyname = "Turkey: Rights and Freedoms Party" in 8
replace votes = 0.23 in 8
replace seats = 0 in 8

replace partyname = "Turkey: People's Liberation Party" in 9
replace votes = 0.17 in 9
replace seats = 0 in 9

replace partyname = "Turkey: Democrat Party" in 10
replace votes = 0.14 in 10
replace seats = 0 in 10

replace partyname = "Turkey: Communist Party" in 11
replace votes = 0.11 in 11
replace seats = 0 in 11

replace partyname = "Turkey: Independent Turkey Party" in 12
replace votes = 0.10 in 12
replace seats = 0 in 12

replace partyname = "Turkey: Democratic Left Party" in 13
replace votes = 0.07 in 13
replace seats = 0 in 13

replace partyname = "Turkey: Liberal Democrat Party" in 14
replace votes = 0.06 in 14
replace seats = 0 in 14

replace partyname = "Turkey: Nation Party" in 15
replace votes = 0.04 in 15
replace seats = 0 in 15

replace partyname = "Turkey: True Path Party" in 16
replace votes = 0.03 in 16
replace seats = 0 in 16


* Removing some parties in Seychelles that should not be there
drop if partyname == "Independents" &  countryname == "Seychelles" & year == 2002
drop if partyname == "United Opposition (UO)" &  countryname == "Seychelles" & year == 2002

drop if partyname == "Democratic Party (DP)" &  countryname == "Seychelles" & year == 2007
drop if partyname == "Independents" &  countryname == "Seychelles" & year == 2007
drop if partyname == "Social Democratic Alliance (SDA)" &  countryname == "Seychelles" & year == 2007
drop if partyname == "United Opposition (UO)" &  countryname == "Seychelles" & year == 2007

save Data/Dinasetal2015_updated2018, replace

****************************************
** Adding data updates by Pedro Riera **
****************************************

import excel "/Users/vicentevalentim/Dropbox/Fragmentation/Data/PR_all data together.xls", sheet("Moldova & Ukraine") firstrow clear

drop B
keep if year > 2011 | countryname == "Seychelles"
rename G votes
rename H seats
rename I threshold
destring threshold, replace force
rename J eleccount
rename K edate
rename L country

destring eleccount, replace force
tostring edate, replace
destring votes, replace


* Adding party names in Seychelles

replace partyname = "Seychelles: Linyon Demokratik Seselwa" in 298
replace partyname = "Seychelles: People's Party" in 299
replace partyname = "Seychelles: Patriotic Movement" in 300

* Fix one wrong value in seats
replace seats = 1 if seats == 0 &  countryname == "Seychelles" & year == 2011

** Adding data on thresholds, election count and election date **
* Ukraine 2012 and 2014
replace country = 31 if countryname == "Ukraine"
replace threshold = 5 if countryname == "Ukraine"
replace eleccount = 5 if countryname == "Ukraine" & year == 2012
replace edate = "28oct2012" if countryname == "Ukraine" & year == 2012

replace eleccount = 6 if countryname == "Ukraine" & year == 2014
replace edate = "26oct2014" if countryname == "Ukraine" & year == 2014

* Moldova 2014
replace country = 20 if countryname == "Moldova"
replace threshold = 4 if countryname == "Moldova" & year == 2014
replace eleccount = 7 if countryname == "Moldova" & year == 2014
replace edate = "30nov2014" if countryname == "Moldova" & year == 2014

* Mexico 2012, 2015 and 2018
replace country = 19 if countryname == "Mexico"
replace threshold = 2 if countryname == "Mexico" & year == 2012
replace eleccount = 5 if countryname == "Mexico" & year == 2012
replace edate = "01jul2012" if countryname == "Mexico" & year == 2012

replace threshold = 3 if countryname == "Mexico" & year == 2015
replace eleccount = 6 if countryname == "Mexico" & year == 2015
replace edate = "07jun2015" if countryname == "Mexico" & year == 2015

replace threshold = 3 if countryname == "Mexico" & year == 2018
replace eleccount = 7 if countryname == "Mexico" & year == 2018
replace edate = "01jul2018" if countryname == "Mexico" & year == 2018

* Netherlands 2012 and 2017
replace country = 21 if countryname == "Netherlands"
replace threshold = 0.67 if countryname == "Netherlands"
replace eleccount = 21 if countryname == "Netherlands" & year == 2012
replace edate = "12sep2012" if countryname == "Netherlands" & year == 2012

replace eleccount = 22 if countryname == "Netherlands" & year == 2017
replace edate = "15mar2017" if countryname == "Netherlands" & year == 2017

ta eleccount if countryname == "Netherlands"

* Norway 2013 and 2017
replace country = 23 if countryname == "Norway"
replace threshold = 4 if countryname == "Norway"
replace eleccount = 7 if countryname == "Norway" & year == 2013
replace edate = "09sep2013" if countryname == "Norway" & year == 2013

replace eleccount = 8 if countryname == "Norway" & year == 2017
replace edate = "11sep2017" if countryname == "Norway" & year == 2017

* New Zealand 2014 and 2017
replace country = 22 if countryname == "New Zealand"
replace threshold = 5 if countryname == "New Zealand"
replace eleccount = 7 if countryname == "New Zealand" & year == 2014
replace edate = "20sep2014" if countryname == "New Zealand" & year == 2014

replace eleccount = 8 if countryname == "New Zealand" & year == 2017
replace edate = "23sep2017" if countryname == "New Zealand" & year == 2017

* Peru 2016
replace country = 32 if countryname == "Peru"
replace threshold = 5 if countryname == "Peru"
replace eleccount = 1 if countryname == "Peru"
replace edate = "10apr2016" if countryname == "Peru"

* Poland 2015
replace country = 24 if countryname == "Poland"
replace threshold = 5 if countryname == "Poland"
replace eleccount = 1 if countryname == "Poland"
replace edate = "25oct2015" if countryname == "Poland"

* Romania 2012 and 2016
replace country = 25 if countryname == "Romania"
replace threshold = 5 if countryname == "Romania"
replace eleccount = 6 if countryname == "Romania" & year == 2012
replace edate = "09dec2012" if countryname == "Romania" & year == 2012

replace eleccount = 7 if countryname == "Romania" & year == 2016
replace edate = "11dec2016" if countryname == "Romania" & year == 2016

* Seychelles 2011 and 2016
replace country = 33 if countryname == "Seychelles"
replace threshold = 10 if countryname == "Seychelles"
replace eleccount = 1 if countryname == "Seychelles" & year == 2011
replace edate = "01oct2011" if countryname == "Seychelles" & year == 2011

replace eleccount = 2 if countryname == "Seychelles" & year == 2016
replace edate = "08sep2016" if countryname == "Seychelles" & year == 2016

* Slovakia 2012 and 2016
replace country = 27 if countryname == "Slovakia"
replace threshold = 5 if countryname == "Slovakia"
replace eleccount = 8 if countryname == "Slovakia" & year == 2012
replace edate = "10mar2012" if countryname == "Slovakia" & year == 2012

replace eleccount = 9 if countryname == "Slovakia" & year == 2016
replace edate = "05mar2016" if countryname == "Slovakia" & year == 2016

* Slovenia 2014 and 2018
replace country = 28 if countryname == "Slovenia"
replace threshold = 4 if countryname == "Slovenia"
replace eleccount = 7 if countryname == "Slovenia" & year == 2014
replace edate = "13jul2014" if countryname == "Slovenia" & year == 2014

replace eleccount = 8 if countryname == "Slovenia" & year == 2018
replace edate = "03jun2018" if countryname == "Slovenia" & year == 2018

* Sweden 2014 and 2018
replace country = 29 if countryname == "Sweden"
replace threshold = 4 if countryname == "Sweden"
replace eleccount = 14 if countryname == "Sweden" & year == 2014
replace edate = "14sep2014" if countryname == "Sweden" & year == 2014

replace eleccount = 15 if countryname == "Sweden" & year == 2018
replace edate = "09sep2018" if countryname == "Sweden" & year == 2018

* Taiwan 2008, 2012 and 2016
replace country = 34 if countryname == "Taiwan"
replace threshold = 5 if countryname == "Taiwan"
replace eleccount = 1 if countryname == "Taiwan" & year == 2008
replace edate = "12jan2008" if countryname == "Taiwan" & year == 2008

replace eleccount = 2 if countryname == "Taiwan" & year == 2012
replace edate = "14jan2012" if countryname == "Taiwan" & year == 2012

replace eleccount = 3 if countryname == "Taiwan" & year == 2016
replace edate = "16jan2016" if countryname == "Taiwan" & year == 2016

drop E M N O P Q R S

********************************************************************************
********************************************************************************
********************************************************************************

append using Data/Dinasetal2015_updated2018

keep countryname partyname year votes seats threshold edate country

gen treat = .
replace treat = 0 if seats == 0 
replace treat = 1 if seats > 0

* Fix threshold data in Seychelles. Since 1993, it's been 10 percent. Source: https://www.tandfonline.com/doi/full/10.1080/02589001.2020.1774048?scroll=top&needAccess=true&role=tab
replace threshold = 10 if countryname == "Seychelles"

save Data/Dinasetal2015_updated2018, replace 
